skip to Main Content

Jenkins is working properly itself but in conjunction with proxy server it fails for specific URLs. These URLs don’t have trailing slash and they are failing only when I’m using HTTPS proxy server (Apache). When accessing Jenkins with bypass of proxy server, there’s no any problem.

I have 2 servers. Server 1 is a proxy server (Apache) which delivers HTTPS connection with external world. Server 2 is a Jenkins server. When accessing Jenkins with domain name it firstly goes thru Server 1, then redirects HTTP to HTTPS and then accesses Server 2. In that model, some of URLs are not working because of lack of trailing slash. When accessing Server 2 directly with its IP address, there is no any problem with URLs.

2

Answers


  1. Many people (including me) are experiencing this. It’s endlessly annoying, but on the jenkins bugtracker they either say it doesn’t exist (anymore) or give workarounds. https://issues.jenkins-ci.org/browse/JENKINS-53434

    Login or Signup to reply.
  2. If you are using a reverse proxy you have to make sure you are using the /jenkins prefix in the url.

    You can set it on ubuntu in the file /etc/default/jenkins

    JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=8080 --httpListenAddress=127.0.0.1 --prefix=$PREFIX"
    

    Here is my truncated apache config with the proxy config for a https port on 8079

    <VirtualHost *:8079>
    AllowEncodedSlashes NoDecode
    ProxyRequests Off
    <Proxy http://localhost:8080/jenkins*>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPass /jenkins http://127.0.0.1:8080/jenkins nocanon
    ProxyPassReverse /jenkins http://127.0.0.1:8080/jenkins
    ProxyPassReverse /jenkins https://website.eu:8079/jenkins  
    RequestHeader set X-Forwarded-Proto "https" 
    ProxyPreserveHost On
    

    Then in https://website.eu:8079/jenkins/config update the jenkins url
    https://website.eu:8079/jenkins

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search