Files
tsumugu/frontend/nginx.conf
T
LarsandCursor db4063296b
Deploy Development / deploy (push) Successful in 30s
Test Suite / pytest-backend (push) Successful in 1m40s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 9s
Weise dem Web-App-Manifest den richtigen MIME-Typ zu und registriere einen Service Worker, damit Browser und Handy die Installation anbieten.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 21:51:22 +02:00

53 lines
1.9 KiB
Nginx Configuration File

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
client_max_body_size 21m;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' blob:; connect-src 'self'; frame-src 'self' blob:; object-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
resolver 127.0.0.11 valid=10s ipv6=off;
location ^~ /api/ {
set $docker_backend_svc backend;
proxy_pass http://$docker_backend_svc:8000$request_uri;
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 $http_x_forwarded_proto;
proxy_read_timeout 600s;
}
location ^~ /health/ {
set $docker_backend_svc backend;
proxy_pass http://$docker_backend_svc:8000$request_uri;
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 $http_x_forwarded_proto;
proxy_read_timeout 30s;
}
# .webmanifest ist in den Standard-MIME-Typen dieses Nginx nicht enthalten.
# octet-stream plus nosniff lässt den Browser das Manifest verwerfen,
# dann fehlt das Installationsangebot.
location = /manifest.webmanifest {
types {
application/manifest+json webmanifest;
}
default_type application/manifest+json;
}
location / {
try_files $uri $uri/ /index.html;
}
}