From cfa21af4328dafd9e1c2f4d95ad0e402151ace79 Mon Sep 17 00:00:00 2001 From: Nick Carboni Date: Thu, 12 Oct 2017 17:30:57 -0400 Subject: [PATCH] Use $http_host in trailing slash redirect This allows the port from the request header to be used rather than having the request redirected to the port being used inside the container which may not be accessible Fixes #420 related #420 Signed-off-by: Nick Carboni --- installer/image_build/files/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/image_build/files/nginx.conf b/installer/image_build/files/nginx.conf index 9d547f17f5..3746e869de 100644 --- a/installer/image_build/files/nginx.conf +++ b/installer/image_build/files/nginx.conf @@ -76,7 +76,7 @@ http { location / { # 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;