Skip to content

Commit

Permalink
Don't send Authorization to /v2/ to trigger WWW-Authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandonPierre committed Oct 22, 2024
1 parent 1927c3b commit f7ae429
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ http {

map $dockerAuth $finalAuth {
"" "$http_authorization"; # if empty, keep the original passed-in from the docker client.
"/v2/" ""; # Don't send Authorization to /v2/ to trigger WWW-Authenticate
default "Basic $dockerAuth"; # if not empty, add the Basic preamble to the auth
}

Expand Down Expand Up @@ -259,8 +260,6 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
proxy_hide_header Set-Cookie;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;

proxy_pass_header Www-Authenticate;

# Add the authentication info, if the map matched the target domain.
include "/etc/nginx/conf.d/allowed_override_auth.conf";
proxy_set_header Authorization $finalAuth;
Expand Down

0 comments on commit f7ae429

Please sign in to comment.