Skip to content

Commit 2dfa020

Browse files
fix(nginx): handle relative redirect (#14)
* fix(nginx): handle relative redirect * anchor http instead of wildcard
1 parent 1d03acb commit 2dfa020

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nginx.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
296296
# the proxy_* directives, these will disappear
297297
set $original_uri $uri;
298298
set $orig_loc $upstream_http_location;
299-
299+
# Handle relative re-direct in Location header (as opposed to absolute)
300+
if ($upstream_http_location !~ "^http") {
301+
set $orig_loc "${scheme}://${host}${upstream_http_location}";
302+
}
300303
# during this process, nginx will preserve the headers intended for the original destination.
301304
# in most cases thats okay, but for some (eg: google storage), passing an Authorization
302305
# header can cause problems. Also, that would leak the credentials for the registry

0 commit comments

Comments
 (0)