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?

tintin
  • 445
  • 2
  • 6
  • 12

1 Answers1

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

alphamikevictor
  • 1,062
  • 6
  • 19