Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61328

JENKINS_URL being ignored. Defaulting to localhost

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None

      Issue being seen on Jenkins version 2.204.3, but not 2.204.2.

      When attempting to save a job's configuration, the link behind the save button is one for localhost, and not the URL of the expected Jenkins instance.

      This can also be seen when looking at the parameters used for a particular job.

      This issue can be reproduced 100% of the time.

          [JENKINS-61328] JENKINS_URL being ignored. Defaulting to localhost

          Mark Bretl added a comment -

          I can verify this issue in 2.204.3 and 2.204.4. It happens on any type of 'save', however, if I use 'apply' then I can workaround it.

          Also can reproduce by log in and log out as well.

          Mark Bretl added a comment - I can verify this issue in 2.204.3 and 2.204.4. It happens on any type of 'save', however, if I use 'apply' then I can workaround it. Also can reproduce by log in and log out as well.

          Cefn Hoile added a comment - - edited

          We encountered this in the context of a Jenkins which used an Apache Reverse Proxy to terminate HTTPS and route to localhost

          Consequently the actual request host is localhost, and our speculation is that some logic is using the request host to populate URLs.

          We have a workaround which seems to resolve the issue in our configuration (although we don't know why this would be required), to insert the following Apache directives into our http conf.

          RequestHeader set X-Forwarded-Proto "https"
          RequestHeader set X-Forwarded-Host "%{HTTP_HOST}s"
          RequestHeader set X-Forwarded-Port "443"
          

           Note the trailing 's' in the percent variable expansion. This is deliberate because mod_headers needs to pull the variable from the SSL parameters, as per...

          %{VARNAME}s The contents of the SSL environment variable VARNAME, if mod_ssl is enabled.

           https://httpd.apache.org/docs/current/mod/mod_headers.html

          Cefn Hoile added a comment - - edited We encountered this in the context of a Jenkins which used an Apache Reverse Proxy to terminate HTTPS and route to localhost Consequently the actual request host is localhost, and our speculation is that some logic is using the request host to populate URLs. We have a workaround which seems to resolve the issue in our configuration (although we don't know why this would be required), to insert the following Apache directives into our http conf. RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Host "%{HTTP_HOST}s" RequestHeader set X-Forwarded-Port "443"  Note the trailing 's' in the percent variable expansion. This is deliberate because mod_headers needs to pull the variable from the SSL parameters, as per... %{VARNAME}s  The contents of the SSL environment variable VARNAME, if mod_ssl is enabled.   https://httpd.apache.org/docs/current/mod/mod_headers.html

          I moved this issue from the INFRA project to JENKINS because it does not seem to be "reporting a bug with the Jenkins web site, wiki, or any other services run by the Jenkins project" as described in How to report an issue. See also Infrastructure.

          Kalle Niemitalo added a comment - I moved this issue from the INFRA project to JENKINS because it does not seem to be "reporting a bug with the Jenkins web site, wiki, or any other services run by the Jenkins project" as described in How to report an issue . See also Infrastructure .

            Unassigned Unassigned
            garejon Gareth Jones
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: