How to configure Jenkins to run on port 80

后端 未结 13 2208
走了就别回头了
走了就别回头了 2020-12-12 21:45

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

13条回答
  •  心在旅途
    2020-12-12 22:37

    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)

提交回复
热议问题