Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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