• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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