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

I am trying to redirect from an external-facing nginx server to a separate internal server also running nginx. The internal machine will be used for a specific purpose, so I need all requests to http://mydomain/internal to be proxied to this machine. I've set up proxy_pass to handle this, but the response doesn't return to the client (unless I'm testing inside the LAN). I assume this is because the internal machine has a non-routable internet IP, so I need to have it pass back through the external machine--how do I do this?

I'd like to avoid giving this machine a public IP. I've been Googling and trying various nginx.conf options (which is why I hesitate to post them right away), but have not had luck yet.

share|improve this question

Use proxy_pass.

  1. Test from external-facing nginx: telnet IP_INTERNAL_NGINX 80... or other port if you use
  2. Read the logs of external and internal nginx
share|improve this answer

You are sure that the internal device has setup it's routing tables correct ?

share|improve this answer

I've gotten this working--it was simply modifying the server_name on the internal machine. I set it to the exposed domain and it worked as expected.

share|improve this answer

Your Answer


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