• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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