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

Absolute URLs in delivery pipeline break reverse proxy setups

    XMLWordPrintable

Details

    Description

      I'm having trouble with the URLs being generated for XMLHttpRequests behind a reverse proxy. The URLs generated have the http scheme instead of https.

      I believe this could be solved by changing the URL to be relative instead of absolute.

          public String getApiBaseUrl() {
              return Jenkins.getInstance().getRootUrlFromRequest() + getViewUrl();
          }
      

      See attached screen caps demonstrating the behavior I'm seeing.

      Attachments

        Issue Links

          Activity

            Build including fix

            patbos Patrik Boström added a comment - Build including fix
            patbos Patrik Boström added a comment - Did this fix: https://github.com/Diabol/delivery-pipeline-plugin/commit/1fb7d661372e30f347a31fd4d66253744cffe539 Need some help testing it. hpi attached.

            Verified fix on a Apache SSL frontend proxying Jenkins.

            patbos Patrik Boström added a comment - Verified fix on a Apache SSL frontend proxying Jenkins.
            patbos Patrik Boström added a comment - Merged PR https://github.com/Diabol/delivery-pipeline-plugin/pull/74

            Released in 0.8.3

            patbos Patrik Boström added a comment - Released in 0.8.3

            Hi Patrik,

            I'm using 0.8.3 and using firefox 31.0 and I've the same issue and I'm getting this:

            Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<server>/view/<somename>%20pipeline/api/json?_=1408001180386. This can be fixed by moving the resource to the same domain or enabling CORS.

            mbadran mohamed badran added a comment - Hi Patrik, I'm using 0.8.3 and using firefox 31.0 and I've the same issue and I'm getting this: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<server>/view/<somename>%20pipeline/api/json?_=1408001180386. This can be fixed by moving the resource to the same domain or enabling CORS.

            Will reopen this since the previous fix help in some cases and in some cases not.
            Need to fix it by removing the absolute URL:s.

            patbos Patrik Boström added a comment - Will reopen this since the previous fix help in some cases and in some cases not. Need to fix it by removing the absolute URL:s.

            Have open a PR containing fixes where all absolute urls has been replaced by relative ones.

            https://github.com/Diabol/delivery-pipeline-plugin/pull/80

            Will do some more testing and then merge to master and release.

            patbos Patrik Boström added a comment - Have open a PR containing fixes where all absolute urls has been replaced by relative ones. https://github.com/Diabol/delivery-pipeline-plugin/pull/80 Will do some more testing and then merge to master and release.

            Merged to master

            patbos Patrik Boström added a comment - Merged to master

            Released in 0.8.5

            patbos Patrik Boström added a comment - Released in 0.8.5

            People

              patbos Patrik Boström
              skwash Josh Hansen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: