• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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