• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Question Caching, expire, compressing on only Nginx

Dukemaster

Regular Pleskian
Hi @ . all,
sorry to come again with the same old story. If there is the an actual solution here in community, I would be also happy and thankful if you could point me to it. Because here is so much with different configuration.
Using apache with Nginx as proxy, others without proxy.
If someone knows the best way to configure caching, expire and compression for only nginx configuration would be great.


Greets

Plesk - Plesk Only Config-1.jpg
 
Last edited:
Hello!,

I am using this code at nginx additional directives.

Code:
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_proxied any;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json application/x-font-ttf application/x-font-opentype image/svg+xml;
gzip_vary on;

location ~* \.(?:ico|gif|jpe?g|png)$ {
    expires 30d;
    add_header Pragma public;
    add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
    expires 7d;
    add_header Pragma public;
    add_header Cache-Control "public";
}

Gzip part is for compression.
Locations part are for caching static resources.

This woked for me at Google Page Speed Insights, I am using it on Wordpress site with apache and nginx as reverse proxy. Remember to uncheck "serve static resources from nginx" option, and include all mime-types or extensions you want to cache on nginx additional directives.

Hope this helps!.
 
Back
Top