0

Thank you in advance for your response,

I've looked on the same question but nowhere to be found, so I'm gonna post here about my question,

So I have a RHEL OS and I have 2 separate IP(See Image)

IP1 is 192.168.10.3 as my web in port 80 IP2 is 192.168.11.3 as my web in port 80(Private)

External access on the firewall from WAN IP mapped to IP1

What I wanna do is when IP1 was accessed externally thru firewall WAN it will route to IP2 instead so I will serve the webpage of IP2, more like a proxy IP1 > IP2. is this possible with apache or nginx? I'm both new on this one and I'm at lost since the IP2 was private network and no internet access only can be, if possible an internal proxy or routing thru IP1.

IP2 cannot be directly mapped to firewall only IP1

will this be achievable from Iptables? like forward the network traffic from IP1:80 to IP2:80 and everytime IP1 is access thru the WAN mapped to, it will show the webpage for IP2?

Every ideas is accepted. Thank you very much community.

Best Regards, Ian

See Image Below

Yien
  • 5
  • 2

1 Answers1

0

As I understand, IP1 as a reverse proxy for IP2. So I suggest you use Nginx to do this as below:

location /route {
    proxy_pass  http://192.168.11.3:80/;
}

Also you can read more about proxy_pass at here. Hope this helps.

tien
  • 65
  • 3
  • Hi TienPhan, thank you for your response sir, yes, so by this whenever every request from IP1 will serve pages dedicated for IP2? just to confirm, the server will be hosted by IP1. – Yien May 31 '19 at 03:54
  • sure @Yien you have it. I also explain more clearly flow: client request ---> IP1 then forward ---> IP2. 1. client don't know existing IP2, they only know IP1. 2. when IP1 receives incoming request from client, it follows proxy_pass to forward to destination (IP2). So, you see IP1 is a reverse proxy of IP2. You can have more IP* behinds IP1 with the same approaches. – tien May 31 '19 at 04:46
  • Thanks a lot mate, this sure is solves my problem, i thought I'm gonna do some firewall stuff. Have a great day mate – Yien May 31 '19 at 05:22