Welcome! Log In Create A New Profile

Advanced

Problems with setting max-age header directive

ST
June 13, 2017 09:48AM
Hello,

I try to set max-age header using expires, as follows:

location / {
# set up max-age header directive for certain file types for proper
caching
location ~* \.(?:css|js|ico|gif|jpe?g|png|mp3|mpeg|wav|x-ms-wmv|eot|
svg|ttf|woff|woff2)$ {
expires 7d;
add_header Cache-Control "public";
}

location /static_files/ {
expires 7d;
add_header Cache-Control "public";
}
try_files $uri $uri/ @nc-rewrite;
}

My problem are files that do not have proper extension, but need to
cached and they are located in /static_files/. For some reason
location /static_files/ {} is used according to logs (see bellow), but
max-age/Cahe-Control is not set. Why?

Thank you in advance!

----error.log-----

2017/06/13 16:43:18 [debug] 30872#0: *1 using configuration
"/static_files/"


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problems with setting max-age header directive

ST June 13, 2017 09:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready