generated from Dicken/dickendock
HTTPS im lokalen Netz (Port 8443, selbstsigniertes Zertifikat, optional mkcert)
This commit is contained in:
32
apps/frontend/nginx-locations.conf
Normal file
32
apps/frontend/nginx-locations.conf
Normal file
@@ -0,0 +1,32 @@
|
||||
# PWA / SPA: alle unbekannten Routen auf index.html zurückführen
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# API-Anfragen an den Backend-Container weiterleiten
|
||||
location /api/ {
|
||||
proxy_pass http://backend:3001/api/;
|
||||
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 $scheme;
|
||||
}
|
||||
|
||||
# Service Worker und Manifest dürfen nicht langfristig gecacht werden,
|
||||
# sonst bekommen installierte PWA-Nutzer nie ein Update mit.
|
||||
location = /sw.js {
|
||||
add_header Cache-Control "no-cache";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location = /manifest.webmanifest {
|
||||
add_header Cache-Control "no-cache";
|
||||
default_type application/manifest+json;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|svg|png|jpg|jpeg|gif|ico|woff2?)$ {
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, max-age=604800, immutable";
|
||||
}
|
||||
Reference in New Issue
Block a user