• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Cache control with Nginx on Wordpress multisite

Mike99

Basic Pleskian
Hello, fellow Pleskians,

I am looking for an advice from a Nginx experienced user, I am trying to set up Cache-Control for a site.

As advised on How to enable leverage browser caching for nginx? this configuration works on single Wordpress install:

location ~* .(js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|woff|woff2|svg)$ {
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
}

But when I use the same configuration on multisite installation, it breaks my site because locations of the static files are not correct, I get 404s for static files in the browser console. My multisite is installed on subdomain https://demo.example.com/site-name, can somebody please advise me on how to change this to make it work? Serve static files directly by nginx and Enable nginx caching is disabled.

Best regards,
Mike
 
Back
Top