Last active
August 21, 2020 16:52
-
-
Save mikehelland/75d81c778b7babdaa0cdb184f0fd02af to your computer and use it in GitHub Desktop.
node port forwarding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# don't do this until you've got certbot run, otherwise it won't validate | |
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8081 | |
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
sudo apt install iptables-persistent | |
# if you need to remove the port forwarding for certbot, these commands list and delete the routes | |
# sudo iptables -t nat -L --line-numbers | |
# sudo iptables -t nat -D PREROUTING 2 | |
sudo ufw allow 8081/tcp | |
sudo ufw allow 8080/tcp | |
sudo ufw allow ssh | |
sudo ufw allow http | |
sudo ufw allow https |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment