45 lines
1.7 KiB
Nginx Configuration File
45 lines
1.7 KiB
Nginx Configuration File
server {
|
|
listen 8080;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Behind a reverse proxy: don't leak the internal port in redirects.
|
|
absolute_redirect off;
|
|
server_tokens off;
|
|
|
|
gzip on;
|
|
gzip_types text/css application/javascript application/manifest+json image/svg+xml;
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'self'; worker-src 'self'; manifest-src 'self'; connect-src 'self'; base-uri 'self'; frame-ancestors 'none'" always;
|
|
|
|
location = /healthz {
|
|
access_log off;
|
|
default_type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
# Always revalidate the entry points so updates roll out promptly.
|
|
location = /sw.js {
|
|
add_header Cache-Control "no-cache" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
}
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'self'; worker-src 'self'; manifest-src 'self'; connect-src 'self'; base-uri 'self'; frame-ancestors 'none'" always;
|
|
}
|
|
location = /manifest.webmanifest {
|
|
default_type application/manifest+json;
|
|
add_header Cache-Control "no-cache" always;
|
|
}
|
|
|
|
location / {
|
|
add_header Cache-Control "public, max-age=3600" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
}
|