diff --git a/systems/hetzner/nginx.nix b/systems/hetzner/nginx.nix index e323692..3ceaebe 100644 --- a/systems/hetzner/nginx.nix +++ b/systems/hetzner/nginx.nix @@ -62,7 +62,30 @@ "hetzner" = { forceSSL = false; enableACME = false; - locations."/".proxyPass = "http://127.0.0.1:1242"; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:1242"; + proxyWebsockets = true; + extraConfig = '' + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Server $host; + proxy_http_version 1.1; + proxy_set_header Connection "Upgrade"; + proxy_set_header Upgrade $http_upgrade; + ''; + }; + "/Api/NLog" = { + proxyPass = "http://127.0.0.1:1242"; + extraConfig = '' + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Server $host; + ''; + }; + }; }; }; };