• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question WordPress Cache Problem

bmalkoc

Basic Pleskian
Hello. I tried all popular cache plugins but WordPress cache doesn't work in nginx. I think it is related to nginx configuration. I am using this code (found in plesk website). Is that correct? Or what can i do for fix this?

Code:
# WORDPRESS PERMALINKS
if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php?q=$1 last;
}

# GZIP Compression
gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_proxied any;
gzip_comp_level 9;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml;
gzip_vary on;

# NGINX Caching
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff)$ {
    expires 30d;
    add_header Cache-Control "public";
    log_not_found off;
}

location ~* \.(jpg|jpeg|gif|png)$ {
    expires 365d;
    log_not_found off;
}

location ~* \.(pdf|css|html|js|swf)$ {
    expires 2d;
    log_not_found off;
}

location ~ \.css {
    add_header  Content-Type    text/css;
}
location ~ \.js {
    add_header  Content-Type    application/x-javascript;
}

# SECURITY
location ~* wp-config.php { deny all; }
location ~* "^/wp-content/(?!plugins/).*\.php" { deny all; }
 
Hi,
where have you found the config above?
You can try removing the #SECURITY-Part at the bottom, maybe this is blocking the access.
Have you disabled the "Proxy mode"?
 
Hi,
where have you found the config above?
You can try removing the #SECURITY-Part at the bottom, maybe this is blocking the access.
Have you disabled the "Proxy mode"?
Hello thanks for your reply. I don't remember where i found. I deleted security section but doesn't work. Also proxy mode is disabled.
 
Alright, which caching plugin are you using?
I would try removing the whole #NGINX Caching section and let it handle with the wp caching plugin.
 
For me, wp rocket is working fine (disabled proxy mode, no nginx caching, no serving of static files by nginx).
Which php handler are you using?
 
I've no additional nginx settings configured which would affect anything like that.
How do you check if the files are cached or not?
 
Your "Additional nginx directives" empty right?

I am checking cache from source code. There is must be "<!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket." text. And scripts not minified and combined.
 
Are you using cloudflare or something else that might be caching the website before your wp rocket installation?
 
Back
Top