• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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