48 lines
1.3 KiB
Nginx Configuration File
48 lines
1.3 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Gzip for the text assets.
|
|
gzip on;
|
|
gzip_types text/html text/css application/javascript application/json image/svg+xml;
|
|
gzip_min_length 512;
|
|
|
|
# Lightweight health endpoint for Coolify / Docker healthcheck.
|
|
location = /healthz {
|
|
access_log off;
|
|
add_header Content-Type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
# Vendor libs + fonts can be cached hard.
|
|
location /vendor/ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Service worker and manifest must always revalidate.
|
|
location = /sw.js {
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
location = /manifest.webmanifest {
|
|
default_type application/manifest+json;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
# Never cache the app shell, so updates land immediately.
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri.html $uri/ /index.html;
|
|
}
|
|
|
|
# Minimal hardening headers.
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
}
|