I am a long term linux desktop user but I am not very technical.
I have in the past also set up and run a couple of VPSs to handle personal email, wordpress and nextcoud. Recently I have been introduced to LXD and it offers the potential to manage these kinds of services through one vps using containers. So I have set up a VPS and installed LXD 4.0.1 I have created two containers, one running nginx and one running my mailserver.
I am very new to this type of configuration, for example I had never used nginx or iptables before the last couple of weeks but with the help of one contributor to a forum and other forum posts I am making some progress.
I have used IP Tables to set up a nat configuration as follows
iptables -t nat -A PREROUTING -d /32 -i eth0 -p tcp -m multiport --dports 80,443 -m comment --comment NGINX -j DNAT --to-destination 10.133.231.106
iptables -t nat -A PREROUTING -d /32 -i eth0 -p tcp -m multiport --dports 25,143,993,587,465,4190 -m comment --comment MAIL -j DNAT --to-destination 10.133.231.181
I have configured nginx as a reverse proxy to handle port 80 and 443 traffic for my mailserver to be routed to my mailserver, which I can see is receiving this traffic.
However I am confused about whether I need to set up post-routing entries in the nat table with Iptables and whether there are other obvious things that I should be exploring.
My immediate question is what post routing commands do I need in iptables and what would be the appropriate syntax.
Thanks in advance for any help you can give.