Add Expires Headers inside NGINX

toplisek

Well-Known Member
Jan 7, 2010
260
20
68
I try to add Add Expires Headers inside NGINX Manager. I found excellent article

Add Expires Headers
Source: How to Add Expires Headers in WordPress

But when it is manually added code inside config it will break NGINX Manager. Is it possible to be added checkbox inside NGINX due to performance or code will not work?

location ~* \.(jpg|jpeg|gif|png|svg)$ {
expires 365d;
}

location ~* \.(pdf|css|html|js|swf)$ {
expires 2d;
}
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,743
1,868
363
cPanel Access Level
Root Administrator
Hey there! Can you get me some more specific details? Can you let me know exactly what is breaking inside the Nginx Manager interface, and if you see any errors insidue the cPanel log at /usr/local/cpanel/logs/error_log?

If you can provide me with steps on how I can reproduce this problem I'd be happy to test that on my end.
 

toplisek

Well-Known Member
Jan 7, 2010
260
20
68
How to test GZIP and Pingdom as 100/100?

Is it possible that CloudFlare compressed file as Brotli and Pingdom has false signal?
Under current conditions inside cPanel and enabled NGINX it is not working or detected GZIP. When I tested KINSTA post, I doubt they are wrong but cPanel will report an error. So, which code is validated to get a better ranking 100/100?

Source: How to Add Expires Headers in WordPress


location ~* \.(jpg|jpeg|gif|png|svg)$ {
expires 365d;
}

location ~* \.(pdf|css|html|js|swf)$ {
expires 2d;
}
 

toplisek

Well-Known Member
Jan 7, 2010
260
20
68
I have an issue as above code will post an error inside cPanel or you have validated code which will work?