My home infrastructure
- Add
GatewayPorts yes
to/etc/ssh/sshd_config
- Restart ssh service by
sudo systemctl restart sshd
$ sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
$ sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443