• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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