How to use nginx to proxy to a host requiring authentication?

Posted by bwizzy on Server Fault See other posts from Server Fault or by bwizzy
Published on 2011-02-03T17:53:57Z Indexed on 2012/09/23 15:40 UTC
Read the original article Hit count: 337

Filed under:
|

How can I setup an nginx proxy_pass directive that will also include HTTP Basic authentication information sent to the proxy host?

This is an example of the URL I need to proxy to:

http://username:[email protected]/export?uuid=1234567890

The end goal is to allow 1 server present files from another server (the one we're proxying to) without exposing the URI of the proxy server. I have this working 90% correct now from following the Nginx config found here:

http://kovyrin.net/2010/07/24/nginx-fu-x-accel-redirect-remote/

I just need to add in the HTTP Basic authentication to send to the proxy server

© Server Fault or respective owner

Related posts about nginx

Related posts about proxy