Update nginx.conf
This commit is contained in:
27
nginx.conf
27
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 '
|
||||
<html>
|
||||
<head>
|
||||
<title>Dienst offline</title>
|
||||
</head>
|
||||
<body style="font-family:sans-serif;text-align:center;padding-top:10%">
|
||||
<h1>Ein Dienst ist momentan nicht erreichbar</h1>
|
||||
<p>Bitte Seite neu laden – Verbindung wird automatisch erneut versucht.</p>
|
||||
</body>
|
||||
</html>';
|
||||
}
|
||||
#############
|
||||
|
||||
# ---- 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;
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user