From 40d0bf6b603c506e15824b4dbbfd2636ab485146 Mon Sep 17 00:00:00 2001 From: Fredrik Baberg Date: Mon, 26 Sep 2022 21:47:50 +0200 Subject: [PATCH] Update nginx config --- 3dprinter-octoprint/config.yaml | 2 +- .../rootfs/etc/nginx/templates/ingress.gtpl | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/3dprinter-octoprint/config.yaml b/3dprinter-octoprint/config.yaml index 488c7ff..17a797b 100644 --- a/3dprinter-octoprint/config.yaml +++ b/3dprinter-octoprint/config.yaml @@ -1,5 +1,5 @@ name: "3DPrinter-OctoPrint" -version: "2022.9.005" +version: "2022.9.006" slug: "3dprinter-octoprint" description: "OctoPrint as an addon, no additional bells and whistles." url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint" diff --git a/3dprinter-octoprint/rootfs/etc/nginx/templates/ingress.gtpl b/3dprinter-octoprint/rootfs/etc/nginx/templates/ingress.gtpl index 7873a1d..2552013 100644 --- a/3dprinter-octoprint/rootfs/etc/nginx/templates/ingress.gtpl +++ b/3dprinter-octoprint/rootfs/etc/nginx/templates/ingress.gtpl @@ -9,16 +9,18 @@ server { deny all; proxy_pass http://octoprint/; # make sure to add trailing slash here! - proxy_set_header X-Forwarded-For 172.30.32.2, $proxy_add_x_forwarded_for; # This is intentional, access through Ingress should use "autologin local". - proxy_set_header X-Forwarded-Host $host + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For 172.30.32.2; # Intentional, use autologin local instead of $proxy_add_x_forwarded_for for Ingress. + proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Script-Name {{ .ingress_entry }}; proxy_http_version 1.1; client_max_body_size 0; - # proxy_set_header Host $http_host; - # proxy_set_header Upgrade $http_upgrade; - # proxy_set_header Connection "upgrade"; - # proxy_set_header X-Real-IP $remote_addr; + + # proxy_set_header X-XSRF-TOKEN $http_x_xsrf_token; } location /webcam/ {