diff --git a/nginx.conf b/nginx.conf index 9bdd8b2..be4437f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -5,6 +5,9 @@ map $http_upgrade $connection_upgrade { '' close; } + + + # ------------------------------------------------------------ # Default HTTP -> HTTPS redirect # ------------------------------------------------------------ @@ -177,6 +180,22 @@ server { ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; + ############# FALLBACK LOCATION (NEU – RICHTIGER ORT) + location @fallback { + default_type text/html; + return 200 ' + +
+Bitte Seite neu laden – Verbindung wird automatisch erneut versucht.
+ + '; + } + ############# + # ---- Static assets: keine Auth ---- location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg|webp)$ { proxy_pass https://appRobot_Simulation:1003; @@ -186,6 +205,8 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; # kein proxy_set_header Connection / Upgrade hier + proxy_intercept_errors on; + error_page 502 503 504 = @fallback; } # ---- WebSocket-Endpoint ---- @@ -205,6 +226,9 @@ server { 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 https; + + proxy_intercept_errors on; + error_page 502 503 504 = @fallback; } # ---- Hauptanwendung ---- @@ -232,6 +256,9 @@ server { proxy_hide_header Content-Security-Policy; add_header Content-Security-Policy "frame-ancestors https://server.schooltech.ch" always; + + proxy_intercept_errors on; + error_page 502 503 504 = @fallback; } # ------------------------------------------------------------