From cc63304cb226decd15aab093f7c53227be08fbb5 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 31 Aug 2022 22:17:01 +0200 Subject: [PATCH] Working ingress --- tandoor_recipes/rootfs/etc/nginx/servers/ingress.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tandoor_recipes/rootfs/etc/nginx/servers/ingress.conf b/tandoor_recipes/rootfs/etc/nginx/servers/ingress.conf index bd14ce07b..9c0ad6869 100644 --- a/tandoor_recipes/rootfs/etc/nginx/servers/ingress.conf +++ b/tandoor_recipes/rootfs/etc/nginx/servers/ingress.conf @@ -12,8 +12,7 @@ server { proxy_read_timeout 30; proxy_set_header Connection "Upgrade"; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Host $http_host; # try $host instead if this doesn't work - + # Allow ingress subpath proxy_set_header X-Script-Name %%ingress_entry%%; proxy_cookie_path / %%ingress_entry%%/; @@ -38,13 +37,17 @@ server { set $x_port ""; } proxy_set_header X-Scheme $x_scheme; + proxy_set_header X-Host $x_host; + proxy_set_header X-Port $x_port; proxy_set_header X-Forwarded-Proto $x_scheme; + proxy_set_header Host $x_host$x_port; # try $host instead if this doesn't work + # Correct url without port when using https sub_filter_once off; sub_filter_types *; - sub_filter https://$host/ $x_scheme://$host$x_port/; - sub_filter http://$host/ $x_scheme://$host$x_port/; + sub_filter https://$x_host/ https://$x_host$x_port/; + sub_filter http://$x_host/ http://$x_host$x_port/; # Rewrite url sub_filter "/static" "%%ingress_entry%%/static";