I've set up two containers with lxd, one with haproxy, pointing to the other with nginx.
I want my server's incoming traffic on port 80 to go to the container with haproxy. This is the rule I've given iptables, but I still cannot access my server from the local network on my laptop (giving the browser the server's local ip).
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.148.218.95:80
I also tried
$ curl http://127.0.0.1:80
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
and
$ curl http://192.168.100.5:80
curl: (7) Failed to connect to 192.168.100.5 port 80: Connection refused
on the server itself.
Can someone enlighten me?