Scout/deploy/nginx.conf
2026-08-31 00:13:15 +08:00

53 lines
1.7 KiB
Nginx Configuration File

map $http_x_forwarded_proto $scout_forwarded_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 512m;
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=()" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data:; font-src 'self'; frame-ancestors 'none'" always;
location /api/v1/updates/stream {
proxy_pass http://scout:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scout_forwarded_proto;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 1h;
}
location /api/ {
proxy_pass http://scout:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scout_forwarded_proto;
proxy_request_buffering off;
proxy_read_timeout 10m;
}
location = /healthz {
proxy_pass http://scout:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scout_forwarded_proto;
}
location / {
try_files $uri $uri/ /index.html;
}
}