How to forward basic-auth from upstream

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: