So I wanted to forward a port for web servers (HTTP, HTTPS) running on an Ubuntu machine behind NAT.
Port forwarding works great for the HTTP server, but for some reason, it doesn't work for the HTTPS server (I did the exact same thing).
Should I do something else for HTTPS server? Here are my iptables settings for reference.
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere anywhere tcp dpt:http to:192.168.40.173:8081
DNAT tcp -- anywhere anywhere tcp dpt:https to:192.168.40.173:8443
Another table.
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.40.173 tcp dpt:tproxy
ACCEPT tcp -- anywhere 192.168.40.173 tcp dpt:http-alt
ACCEPT tcp -- anywhere 192.168.40.173 tcp dpt:https
ACCEPT tcp -- anywhere 192.168.40.173 tcp dpt:8443