Fix Cache-Control headers overriding security headers
This commit is contained in:
parent
3f52323dca
commit
78a7eef119
@ -1,35 +1,35 @@
|
||||
# Don't cache appcache, document html and data.
|
||||
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
||||
add_header Cache-Control "max-age=0";
|
||||
expires 0;
|
||||
}
|
||||
|
||||
# Cache RSS and Atom feeds.
|
||||
location ~* \.(?:rss|atom)$ {
|
||||
add_header Cache-Control "max-age=3600";
|
||||
expires 1h;
|
||||
}
|
||||
|
||||
# Caches images, icons, video, audio, HTC, etc.
|
||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
|
||||
add_header Cache-Control "max-age=31536000";
|
||||
expires 1y;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Cache svgz files, but don't compress them.
|
||||
location ~* \.svgz$ {
|
||||
add_header Cache-Control "max-age=31536000";
|
||||
expires 1y;
|
||||
access_log off;
|
||||
gzip off;
|
||||
}
|
||||
|
||||
# Cache CSS and JavaScript.
|
||||
location ~* \.(?:css|js)$ {
|
||||
add_header Cache-Control "max-age=31536000";
|
||||
expires 1y;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Cache WebFonts.
|
||||
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
|
||||
add_header Cache-Control "max-age=31536000";
|
||||
expires 1y;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user