Skip to content

Instantly share code, notes, and snippets.

@m5m1th
Last active May 27, 2020 04:57
Show Gist options
  • Save m5m1th/6870a54717c0387468c3 to your computer and use it in GitHub Desktop.
Save m5m1th/6870a54717c0387468c3 to your computer and use it in GitHub Desktop.
Redirect port 3080/3443 to 80/443 for local dev
#Requests from outside
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3443
#Requests from localhost
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 3443
@nyukhalov
Copy link

nyukhalov commented May 12, 2017

Hi.
After applying that jenkins worked fine, but docker daemon which was installed on the same node got crazy: all http requests from a docker container got 404 Not Found. I suppose the requests were redirected to localhost for some reason and obviously could not be handled.

I'm on Ubuntu 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment