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

JENKINS_URL being ignored. Defaulting to localhost

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            scmbuildguy 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.

            Show
            scmbuildguy 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.
            Hide
            cefn 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

            Show
            cefn 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
            Hide
            kon 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.

            Show
            kon 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 .

              People

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

                Dates

                Created:
                Updated:
                Resolved: