• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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