how to forward basic-auth from upstream

mex nginx-forum at forum.nginx.org
Thu Mar 10 16:19:03 UTC 2016


hi list,


i have an nginx infront of apaches, and the apacheshold a list of locations
with basic-auth. 

i cannot pass the auth-request from the upstream through nginx to
the user, when i access the urls through nginx  i get 403 Forbidden,
while direct access sends the correct 401 Authorization Required
back. 

is there a simple way to passthrough the auth-request without 
doing nginx basic-auth itself?


what i've done so far (in any variation)


location /authme {
        ...
        proxy_pass_header  Authorization;
        more_set_headers        -s 401 'WWW-Authenticate: Basic
realm="$host"';
        more_set_input_headers  'Authorization: $http_authorization';
        ...
}


cheers, 

mex

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,265220,265220#msg-265220



More information about the nginx mailing list