• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Expire Headers in Plesk Nginx & Apache

Yaashul

New Pleskian
I would like to use expire header for images. I know this the code for doing it.

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 7d;
}

Now the question is where shud I put this code.

I can't edit vhost configuration of nginx coz it will remove the following code once nginx updates itself.

Please suggest me the right place to put this code.
 
I just upgraded to Pleask 11.5 and i added the expire cache thanks to the new feature.

To do so:
1. Upgrade to 11.5 if it is not yet done (Upgrade option in tools & settings)
2. click on your website
3. Click on website & domains
4. click on a domain below the 3 buttons (add new domain add new subdomain add new domain)
5. Click on web server setting and scroll down to the bottom of the page
6. Copy and paste & save

Capture d’écran 2013-06-17 à 11.11.37.png
 
Hi,

I noticed that there is one issue with this. If you enable server static files via nginx then these rules won't apply.

They key is adding the try_files directive and making sure you remove the filetypes from the static files list.

I've written a small guide on my Blog.
 
Back
Top