I have Jenkins running on Tomcat with HAProxy as a reverse proxy in front of it. That works kind of OK and my haproxy.conf is listet at the end of my post, but I have a problem with rewriting paths in the response.
when I GET ht.tp://192.168.1.16/jenkins I get the correct HTML returned, but all links are absolute to the host’s root, and thus my webbrowser cannot fetch them as it tries e.g. ht.tp://192.168.1.16/static/style.css instead of ht.tp://192.168.1.16/jenkins/static/style.css.
If only it was a matter of rewriting domains, I would be home safe, but because of that pesky start o the path I am stuck.
I have tried to change the server and/or host to ht.tp://192.168.1.16/jenkins as in the configuration file below.
Can what I want be one?
How? Any pointers and hints are appreciated. (I tried setting the JENKINS_URL in the jenkins control panel, which didn’t work. Also a generic solution would be convenient.)
Ok , Jenkins listens on 192.168.2.67:8080. Once you hit the URL , it shows 192.168.2.67:8080/login in the browser , which then loads the login page . You enter the credentials and after successful authentication Jenkins will take you to 192.168.2.67:8080 , which means you have logged in . All good now
I have HAPRoxy installed on another server , and need to give my users /jenkins , so that it redirects to the above URL .
The first request to the same through HAProxy happens , perfectly , as it finds the prefix and redirects to backend , that loads the login page , with the URL showing /login in the address bar. You see the Jenkins application as prefixed it with /login , with the HAPROXYIP .
Once the login page is shown , and enter the credentials , Jenkins get 401 as it does not find the actual ACL now for /login.