Welcome! Log In Create A New Profile


Nginx proxy with multiple ips behind VPN

Posted by usamahateeq 
Nginx proxy with multiple ips behind VPN
June 21, 2020 07:17AM
I have a tornadoweb server hosted on a machine and nginx server on top on that machine. All routes to nginx are then redirected to the tornadoweb server.

The tornadoweb server requests information from some other systems that are behind vpns. nginx is able to proxy pass those because openvpn is also installed on the same system.

Now the problem is we will be adding 100 more ips that are behind vpns. How is it best solvable. Right now I can only think of adding 100 locations in the sites-available default configuration, but when it will increase to 1000 then ill have to add 1000 configs in that file.

Is there a better dynamic solution for this instead of adding an entry for each system behind vpn.

I tried hosting another server on the same machine that would access the VPNS only. lets say tornado2. Instead of adding those 100 lines i just added the url path of the tornado2 but that didnt work it gives me error that the server took too long to talk to the vpn ip. But the proxy config for the 100 ips works just fine.
Re: Nginx proxy with multiple ips behind VPN
June 21, 2020 08:05AM
Such dynamics are better solved with Lua by keeping the actual state in memory pulled from a database.
Drop this into google: "nginx lua dynamic proxy"

nginx for Windows http://nginx-win.ecsds.eu/
Re: Nginx proxy with multiple ips behind VPN
July 03, 2020 01:51PM
Thank you very much. Will definitely look into this.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready