I\'m running Ubuntu 11.10 and have run sudo apt-get install jenkins to install Jenkins on this system.
I\'ve seen some tutorials on how to setup a rever
None of the answers tells how to simply redirect 80 to 8080 with iptables.
Fortunately, dskrvk's comment does !
There's also a Jenkins wiki documenting this
I just had to copy/paste those lines in my terminal to get the redirect working :
sudo iptables -I INPUT 1 -p tcp --dport 8443 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
Btw, don't forget to include it to your server's init scripts once tested, or you'll lose the redirect after a reboot. Tested on Debian 8.2 (Jessie)