add more file extensions to cache in nginx.conf

This commit is contained in:
Dawid Wysokiński 2021-01-08 22:28:59 +01:00
parent eeb3a141dc
commit 1c63985e2e

View File

@ -33,15 +33,15 @@ http {
index index.html index.htm;
error_page 404 /404/index.html;
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
# Fonts and media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# Javascript and CSS files
location ~* \.(?:css|js|woff2)$ {
location ~* \.(?:css|json|webmanifest|js|woff2|manifest)$ {
try_files $uri =404;
expires 1y;
access_log off;