Files

54 lines
1.3 KiB
Nginx Configuration File

events {}
http {
include /etc/nginx/mime.types;
map $http_x_forwarded_proto $upstream_forwarded_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
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;
location /api/ {
proxy_pass http://api:5000;
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 $upstream_forwarded_proto;
proxy_set_header X-Forwarded-Host $host;
proxy_connect_timeout 5s;
proxy_read_timeout 30s;
}
location = /index.html {
add_header Cache-Control "no-cache";
expires 0;
}
error_page 404 /404.html;
location = / {
try_files /index.html =404;
}
location / {
try_files $uri/index.html $uri $uri/ =404;
}
location /assets/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable";
}
}
}