Files
skrift-app/nginx.conf
Lucas Orth 32aa0a549f
All checks were successful
Build & Deploy / deploy (push) Successful in 26s
Import aus Monorepo (frischer Start)
2026-08-24 12:13:54 +02:00

43 lines
1.1 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_min_length 1024;
# Sicherheits-Header (TLS terminiert der Nginx Proxy Manager davor)
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Gehashte Assets dürfen dauerhaft gecacht werden.
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Schriften: lokal ausgeliefert, lange cachebar.
location /fonts/ {
expires 1y;
add_header Cache-Control "public, immutable";
types {
font/woff2 woff2;
font/ttf ttf;
}
}
# index.html nie cachen – sonst sehen Nutzer nach einem Deploy die alte App.
location = /index.html {
add_header Cache-Control "no-store, must-revalidate";
}
# SPA-Fallback: /portal, /login usw. existieren nicht als Dateien.
# Ohne diese Zeile führt ein Reload auf einer Unterseite zu 404.
location / {
try_files $uri $uri/ /index.html;
}
}