use a default location block

This commit is contained in:
Daniel Micay 2020-04-01 09:40:59 -04:00
parent 5a923bd1bb
commit 3bb6e98151

View File

@ -70,9 +70,10 @@ server {
default_type text/plain; default_type text/plain;
} }
location ~ "\.(html|txt|xml)$" { location / {
include /etc/nginx/snippets/security-headers.conf; include /etc/nginx/snippets/security-headers.conf;
add_header Cache-Control "public, max-age=1800"; add_header Cache-Control "public, max-age=1800";
try_files $uri $uri.html $uri/ =404;
} }
location ~ "\.(ico|webmanifest)$" { location ~ "\.(ico|webmanifest)$" {
@ -91,7 +92,6 @@ server {
gzip_static off; gzip_static off;
} }
try_files $uri $uri.html $uri/ =404;
charset utf-8; charset utf-8;
include /etc/nginx/snippets/security-headers.conf; include /etc/nginx/snippets/security-headers.conf;
gzip_static on; gzip_static on;