From 10c37df81f6a0c1714eddb868b2cd831142ad03a Mon Sep 17 00:00:00 2001 From: Elijah DeLee Date: Mon, 29 Jan 2024 14:52:37 -0500 Subject: [PATCH] fix nginx append slash to respect proxy This is already fixed in awx-operator. See https://github.com/ansible/awx-operator/blob/a534c856dbebc853191fb2547346007a60f137db/roles/installer/templates/configmaps/config.yaml.j2#L215 This just makes it so a development environment can also work correctly behind a proxy Fixes problem of GET to https://$PROXY/something/awx/v2/me rewritten to https://$AWX/something/awx/v2/me/ (which doesn't exist) instead path is correctly rewritten as https://$PROXY/something/awx/v2/me/ --- .../ansible/roles/sources/templates/nginx.locations.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 b/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 index be8496eee20e..ca82f92c5584 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/nginx.locations.conf.j2 @@ -34,7 +34,7 @@ location {{ (ingress_path + '/websocket').replace('//', '/') }} { location {{ ingress_path }} { # Add trailing / if missing - rewrite ^(.*[^/])$ $1/ permanent; + rewrite ^(.*)$http_host(.*[^/])$ $1$http_host$2/ permanent; uwsgi_read_timeout 120s; uwsgi_pass uwsgi; include /etc/nginx/uwsgi_params;