server {
root /usr/share/nginx/html;
# access_log /usr/share/nginx/logs/access.log combined;
# error_log /usr/share/nginx/logs/error.log error;
include mime.types;
# reuse port on redirects
absolute_redirect off;
try_files $uri $uri/ /index.html =404;
location = /index.html {
expires 0;
add_header Cache-Control 'no-cache';
break;
}
location = /sw.js {
expires 0;
add_header Cache-Control 'no-cache';
break;
}
location = /favicon.ico {
access_log off;
break;
}
location = /manifest.json {
access_log off;
break;
}
location /logs {
access_log off;
auth_basic 'Restricted';
auth_basic_user_file /etc/nginx/.htpasswd;
}
location ~ ^/(favicon\.png|fonts|js|img|css|app\.js|app\.css) {
# set cache header
expires 0;
break;
}
}