Skip to content

Instantly share code, notes, and snippets.

@thekalinga
Created May 12, 2016 18:53
Show Gist options
  • Save thekalinga/ece85f2ecdc325c3d3dc75f9e0b80cee to your computer and use it in GitHub Desktop.
Save thekalinga/ece85f2ecdc325c3d3dc75f9e0b80cee to your computer and use it in GitHub Desktop.
AWS redirect port 80 -> 8080
iptables --insert INPUT --protocol tcp --dport 80 --jump ACCEPT
iptables --insert INPUT --protocol tcp --dport 8080 --jump ACCEPT
iptables --table nat --append PREROUTING --in-interface eth0 --protocol tcp --dport 80 --jump REDIRECT --to-port 8080
# run next line to have changes survive reboot
service iptables save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment