So as the title suggests what I am trying to do is host my server from one public IP but ive run into issues trying to run Nginx on different virtual machines and of course the issue with that is on my network all of my ports are forwarded to the main server. So what ive tried and seen multiple times is setups like what im about to put down below but all that happens is a I cant ssh into any of my virtual machines expect the main server and Nginx does not even work.
Proxmox server IP:192.168.0.42 (hosting the Proxmox web UI)
Arch Server IP:192.168.0.45 (trying to host website)
........
auto vmbr2
iface vmbr2 inet static
address 192.168.0.45
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.45/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.45/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.45:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.45:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.45:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.45:80
There's probably a very obvious answer here
Proxmox server IP:192.168.0.42 (hosting the Proxmox web UI)
Arch Server IP:192.168.0.45 (trying to host website)
........
auto vmbr2
iface vmbr2 inet static
address 192.168.0.45
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.45/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.45/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.45:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.45:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.45:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.0.45:80
There's probably a very obvious answer here