Applicable to:
- Plesk for Linux
Symptoms
Plesk pages with cookies aren't cached by nginx caching, with this in the page's headers: x-cache-status: BYPASS
Cause
nginx doesn't cache requests that have a Cookie HTTP header by default. Caching for pages that use cookies or user-specified parameters should be configured with great care, as improper setup can compromise website security or cause incorrect behavior in a web application. This feature is therefore disabled by default. The same principle applies to the default behavior of nginx, as outlined in its documentation.
Resolution
To change this behavior, configure the domain to cache pages with cookies in the nginx settings.
-
Log in to Plesk
-
Go to Domains > example.com > Apache & nginx
-
Enter the required cookies in the field Cache requests with cookies
For example, if
_ga
and_gid
cookie names are set, nginx will only cache HTTP requests with cookie headers that contain_ga
or_gid
.
Comments
0 comments
Please sign in to leave a comment.