• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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