Welcome! Log In Create A New Profile

Advanced

Reverse proxy with multiple interfaces

Posted by sbeaver 
Reverse proxy with multiple interfaces
May 01, 2017 10:24AM
I use NGINX to reverse proxy incoming requests from a network interface to a WIldfly application server listening on port 8080. The config is simple:

server {
listen 80;
server_name application.mynet.com;

location /myapplication {
proxy_pass http://127.0.0.1:8080/myapplication/;
}
}

That works as expected. But what if I add a second network interface to the box such that requests from the LAN arrive on one interface, requests from the internet on the other? Let's say that the two interfaces have address 192.168.10.10 and 192.168.20.20 - Is this valid? The incoming URL is the same in both cases, but they are handled differently depending on the interface the request arrived on.

// If the request came from the LAN interface, route it to myapplication
location /myapplication {
proxy_bind 192.168.10.10
proxy_pass http://127.0.0.1:8080/myapplication/;
}

// If the request came from the Internat interface, route it to someotherapplication
location /myapplication {
proxy_bind 192.168.20.20
proxy_pass http://127.0.0.1:8080/someotherapplication/;
}

Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready