John Mark Causing

System Administrator | Hosting Support Engineer

Bacolod City, Philippines

+639393497018

John Mark Causing

System Administrator | Hosting Support Engineer

Bacolod City, Philippines

+639393497018

This is an example of nginx reverse proxy that connects to an LXD server then connects to an LXC container.

Server 1 (LB IP address 192.168.50.27) nginx configuration and mytest.com is the localhost

Server 2 (LXD IP address 192.168.50.75)

Setting up iptables to redirect traffic from this LXD nginx to a specific LXC “wp1”

sudo iptables --table nat --append PREROUTING --destination 192.168.50.75 --protocol tcp --dport 8080  --jump DNAT --to-destination 10.189.124.145:80

LXC “wp1” with nginx (IP address 10.189.124.145)

Testing the reverse proxy IP tables. Screenshot below shows that mytest.com from LB server nginx connects to LXC wp1 nginx server by using Reverse proxy –> IP Tables in LXD –> LXD connects to LXC “wp1” nginx web server