Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
2.5.1
-
None
-
all
Description
Hello,
Varnish purge is not working in SiteAccess Host Matching on eZ Platform Cloud.
https://github.com/ezsystems/ezplatform-http-cache/blob/master/src/PurgeClient/VarnishPurgeClient.php#L56
empty($_SERVER['SERVER_NAME'])
is not empty and contains the "Secured" SiteAccess (admin) host.
Then when you call the purge you've got:
curl https://siteaccess-admin.master-ezp2-wo-bridge-xxxxxx.eu-2.platformsh.site -XPURGE --header "x-invalidate-token: xxxxx" --header "key: xxxx_location-185148" <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="0;url=https://siteaccess-admin.master-ezp2-wo-bridge-xxxxxx.eu-2.platformsh.site/login" /> <title>Redirecting to https://siteaccess-admin.master-ezp2-wo-bridge-xxxxxx.eu-2.platformsh.site/login</title> </head> <body> Redirecting to <a href="https://siteaccess-admin.master-ezp2-wo-bridge-xxxxxx.eu-2.platformsh.site/login/login">https://siteaccess-admin.master-ezp2-wo-bridge-xxxxxx.eu-2.platformsh.site/login</a>. </body> </html>
We fixed the issue by adding this block in our security.yaml
_ez_http_invalidatetoken:
pattern: /_ez_http_invalidatetoken
security: false
We are not saying that is the best way to fix it, but that is at least enough information for you to do it
Thanks, @Florian Alexandre to help to tackle this one.