Forward Jenkins to Port 80 from Jenkins 8080 port
Change Jenkins Port on Linux
In this tutorial i will be showing you how to change Jenkins 8080 to Jenkins 80 / 443 or any other port.
First you have to be sure that Apache HTTPD is installed and running and then open httpd.conf file and use below configuration.
ProxyPass -- Maps remote servers into the local server URL-space.
nocanon -- URL path "raw" to the backend.
ProxyPassReverse -- Adjusts the URL in HTTP response headers sent from a reverse proxied server.
prxyrequests -- Enables forward (standard) proxy requests
AllowEncodedSlashes -- Determines whether encoded path separators in URLs are allowed to be passed through
ProxyPass /jenkins http://localhost:8080/jenkins nocanon
ProxyPassReverse /jenkins http://localhost:8080/jenkins
Allow from all
Add in the end of file "JENKINS_ARGS="--prefix=/jenkins" which means that this is the name of folder which added in above httpd
If you selinux is enabled then you need to run the below commands:
setsebool httpd_can_network_connect true
setsebool httpd_can_network_connect 1
Restart both Jenkins and Apache services
systemctl restart jenkins
systemctl restart httpd