0

So I'm relatively new to nginx but want to know how I can use a reverse proxy to mask the destination server(s) IP addresses. Here is how it works so far:

I have reverse proxy (rp), main server (ms), secondary server (ss)

So when using a nginx proxy currently I connect via rp---ms but via wireshark I see main server IP address as destination. If main server passes me to secondary server for resource I see secondary servers IP address in wireshark.

What I want to develop is rp---ms----ss or rp---ss but to/from traffic only shows ip of the reverse proxy server outgoing and returning - is this possible?

LH94
  • 1
  • 1

1 Answers1

1

Are you checking Wireshark from inside the Nginx network? It is obvious that packets forwarded from Nginx will have the main server IP address as destination, you just need to reconfigure the firewall so that only Nginx is accessible from outside.

Check this diagram that will help you understand how to properly design this.

Diagram on what to do

Marc Sances
  • 2,402
  • 1
  • 19
  • 34
  • Thank you for the reply! So I realize that reverse proxy hides main server ip but not secondary server. So my set up has main server pass me off to multiple servers to retrieve files requested through main server. What ends up showing is the secondary server IP. Would there be anyway to hide that with the nginx proxy as well? – LH94 Aug 20 '20 at 22:26
  • Just make the Main Server go to nginx to request these resources, and let nginx proxy to the second server as well. So you would have double reverse proxy with URL rewrite, see https://stackoverflow.com/questions/32542282/how-do-i-rewrite-urls-in-a-proxy-response-in-nginx – Marc Sances Aug 20 '20 at 22:33