Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

NGINX doesn't seem to recognize my HTTP_PROXY setting in bash profile, is there something I need to do here? Running on OSX Lion.

Just to clarify, I'm setting a reverse proxy that will host static files and route requests to our app qa server which is outside of our network. I just need to know how to get nginx to obey proxy settings.

share|improve this question
nginx is a web server, not typically a client. What is it you're trying to do? – Michael Hampton Aug 3 '12 at 21:14
Not to mention that it's http_proxy, not HTTP_PROXY... – womble Aug 3 '12 at 22:21
plus it's probably starting as a daemon, not from command line – jackweirdy Aug 3 '12 at 22:45
@Michael Hampton - Im trying to set up a reverse proxy. – mrjoshua Aug 4 '12 at 1:08
Welcome to Server Fault. Please edit your question to provide the necessary and relevant details. Extended comment discussions are not really helpful and we try to avoid them when possible. – Michael Hampton Aug 4 '12 at 1:10
up vote 1 down vote accepted

You can't do that.

nginx was designed and intended to reverse proxy to upstream app servers on the same machine or nearby on the local network. It assumes that it has a direct connection available to the upstream servers.

While you can reverse proxy to another machine across the Internet, and this is occasionally useful in migration scenarios, it was never intended to be a "client" that would have to obey proxy server settings. Thus nginx has no functionality to route upstream requests through yet another proxy server.

Some things you can do include:

  • Install nginx on the actual development server where your existing development app server is.
  • Install a copy of the development app server on your local machine, where nginx can proxy to it.
  • Ask your network administrator to poke a hole in the firewall to allow the egress traffic from your workstation to the external app server.

(P.S. I expect you were downvoted because the original question wasn't clear enough to answer; you should expect some of those to go away as the people who downvoted notice the clarified question.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.