Files
k8s-gitops/apps/portfolio/nginx/default.conf
T
2026-07-16 19:45:09 +00:00

59 lines
1.6 KiB
Plaintext

server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
error_page 404 /404.html;
charset utf-8;
access_log /dev/stdout;
error_log /dev/stderr warn;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Content-Security-Policy "default-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; script-src 'none'; connect-src 'none'; object-src 'none'; frame-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests" always;
location = /.well-known/security.txt {
default_type text/plain;
try_files /security.txt =404;
}
location = /404.html {
internal;
}
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location ~* \.(css|svg|png)$ {
expires 7d;
try_files $uri =404;
}
location ~* \.(pdf|xml)$ {
expires 1h;
try_files $uri =404;
}
location ~* \.html$ {
expires -1;
try_files $uri =404;
}
location / {
try_files $uri $uri/ $uri.html /index.html;
}
}