• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • Jenkins 1.496 and Build Failure Analyzer 1.4.0

      I use a reverse proxy on my jenkins with a security management and icons are no more displayed from 1.4.0 version.
      Plugin does not use the reverse proxy for create image url : http://computer_name:8080//plugin/build-failure-analyzer/images/48x48/information.png.

          [JENKINS-16868] Icons are not displayed with a reverse proxy

          Sylvain C. created issue -

          Does it work for you if you remove the double slash before plugin in the url?

          Tomas Westling added a comment - Does it work for you if you remove the double slash before plugin in the url?

          Sylvain C. added a comment -

          In fact, this url works : http://reverse-proxy//plugin/build-failure-analyzer/images/48x48/information.png but url image is http://computer_name:8080//plugin/build-failure-analyzer/images/48x48/information.png and anonymous have no right on this url for security management.

          Sylvain C. added a comment - In fact, this url works : http://reverse-proxy//plugin/build-failure-analyzer/images/48x48/information.png but url image is http://computer_name:8080//plugin/build-failure-analyzer/images/48x48/information.png and anonymous have no right on this url for security management.

          Ok, I hoped the slashes would have something to do with it but it seems to be 2 different problems then.

          Tomas Westling added a comment - Ok, I hoped the slashes would have something to do with it but it seems to be 2 different problems then.

          Sylvain C. added a comment - - edited

          The plugin uses getRootUrlFromRequest() ( http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getRootUrl() ) for getting image base url but I read in jenkins api documentation this method is not compatible with reverse proxy whereas I believe getRootUrl() ( http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getRootUrlFromRequest() ) works with a reverse proxy.

          Sylvain C. added a comment - - edited The plugin uses getRootUrlFromRequest() ( http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getRootUrl( ) ) for getting image base url but I read in jenkins api documentation this method is not compatible with reverse proxy whereas I believe getRootUrl() ( http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getRootUrlFromRequest( ) ) works with a reverse proxy.

          Sylvain C. added a comment -

          Please any ideas ? I really want to use your plugin !
          thanks

          Sylvain C. added a comment - Please any ideas ? I really want to use your plugin ! thanks

          By using getRootUrl, we got problems with users using a context path which isn't the root. We will look into the problem and see if we can find something which works for everyone.

          Tomas Westling added a comment - By using getRootUrl, we got problems with users using a context path which isn't the root. We will look into the problem and see if we can find something which works for everyone.

          I came up with solution that works for most cases. The one case it won't work is when you are running behind a reverse proxy and don't fill out the Jenkins URL in settings. getRootUrl() uses getRootUrlFromRequest() as a fallback if the field is left blank, but since it doesn't work behind reverse proxy we won't be able to find out the rootUR. Make sure to fill out the field

          I will try to release the fix as soon as I can.

          Tomas Westling added a comment - I came up with solution that works for most cases. The one case it won't work is when you are running behind a reverse proxy and don't fill out the Jenkins URL in settings. getRootUrl() uses getRootUrlFromRequest() as a fallback if the field is left blank, but since it doesn't work behind reverse proxy we won't be able to find out the rootUR. Make sure to fill out the field I will try to release the fix as soon as I can.

          Sylvain C. added a comment -

          Great, the field is already filled.
          Thanks !

          Sylvain C. added a comment - Great, the field is already filled. Thanks !

          rsandell added a comment -

          Commit: e4f7fb996be928c5fdb236a78e67e4350fcd512f

          rsandell added a comment - Commit: e4f7fb996be928c5fdb236a78e67e4350fcd512f

            t_westling Tomas Westling
            sylvainc Sylvain C.
            Votes:
            7 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: