• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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