Add caching headers

This commit is contained in:
Hubert Van De Walle 2020-05-01 00:08:01 +02:00
parent 280802d38a
commit 2b7053ff8b

View File

@ -28,6 +28,12 @@ server {
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
location ~* \.(css|js)$ {
root /usr/share/nginx/html;
expires 1d;
add_header Cache-Control "public, max-age=86400";
}
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;