2

I have an apache server sitting between a Jenkins server running on 127.0.0.1:8090 and the client browser.

I am giving http://123.45.67.89/jenkins in the browser and expecting the Jenkins to be redirected to http://123.45.67.89/jenkins/login page but instead, I am redirected to http://123.45.67.89/login page.

In the apache httpd.conf I tried giving the ProxyPass and ProxyPassReverse

LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_module modules/mod_proxy.so
ProxyPass /jenkins http://127.0.0.1:8090/
ProxyPassReverse /jenkins http://127.0.0.1:8090/

From what I understand about ProxyPassReserve is that it would rewrite the response header with /jenkins/login so that when the browser sends the redirected request again it would be http://127.0.0.1:8090/jenkins/login

Not sure if my understanding is correct or is there something I am missing?

1 Answer 1

0

Try to add also:

ProxyPassReverse /jenkins http://123.45.67.89/

Probably on the ProxyPass you are maintaining the original host header (ProxyPreserveHost On), if so with this ProxyPassReverse probably will do the trick for you.

EDIT:

I've checked on my mini lab and the point is jenkins is not doing a redirection but it is giving you this html

<meta http-equiv='refresh' content='1;url=/login?from=%2F'/>

I solved it starting jenkins with switch --prefix=/jenkins

4
  • This is not working.
    – tintin
    Feb 28, 2017 at 20:11
  • @tintin I've edited and changed the way to start jenkins (if possible for you) Mar 1, 2017 at 6:10
  • I am starting jenkins as a service, so the prefix is getting ignored sudo service jenkins start --prefix=/jenkins Is there any way to pass the param?
    – tintin
    Mar 2, 2017 at 7:21
  • Which OS? If RedHat/CentOS probably you have some files on /etc/sysconfig directory which allows you to change parameters for jenkins. Mar 3, 2017 at 7:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .