Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support digest authentication as reverse proxy #18

Open
jkldgoefgkljefogeg opened this issue Dec 29, 2018 · 5 comments
Open

support digest authentication as reverse proxy #18

jkldgoefgkljefogeg opened this issue Dec 29, 2018 · 5 comments

Comments

@jkldgoefgkljefogeg
Copy link

Support digest authentication to origin when used with proxy_pass

Currently nginx reverse proxy only supports basic authentication with proxy_set_header Authorization

@erikdubbelboer
Copy link

Have you tried setting:

proxy_set_header   Authorization $http_authorization;
proxy_pass_header  Authorization;

I don't have a setup to test this but I think it should work.

@jkldgoefgkljefogeg
Copy link
Author

The goal is to use nginx reverse proxy to strip HTTP authentication requested by origin, so client does not need to perform HTTP authentication.

@erikdubbelboer
Copy link

You want nginx to fill in the correct Authorization header for the upstream? If so I'm afraid that isn't possible as digest authentication is different for each request. This works with proxy_set_header Authorization for basic auth because for basic auth the header is always the same.

@jkldgoefgkljefogeg
Copy link
Author

Yeah basically have digest auth work in the opposite direction (nginx as auth client, reads credentials from local file and answer challenges from origin)

@erikdubbelboer
Copy link

I don't think that's ever possible with nginx. The problem is that it usually requires 2 requests for digest auth. One to get the server nonce as response and the next request with the correct Authorization header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants