From 31dd4900f5a61bb251a2a3b469bd494a9d517268 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 14 Oct 2024 19:59:28 +0200 Subject: [PATCH] update asf server config --- systems/hetzner/nginx.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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; + ''; + }; + }; }; }; };