Class ReverseProxySetupMonitor

  • All Implemented Interfaces:
    ExtensionPoint, ModelObject, SearchableModelObject, SearchItem, org.kohsuke.stapler.StaplerProxy

    @Extension
    @Symbol("reverseProxy")
    public class ReverseProxySetupMonitor
    extends AdministrativeMonitor
    Looks out for a broken reverse proxy setup that doesn't rewrite the location header correctly.

    Have the JavaScript make an AJAX call, to which we respond with 302 redirect. If the reverse proxy is done correctly, this will be handled by web methods, but otherwise we'll report that as an error. Unfortunately, XmlHttpRequest doesn't expose properties that allow the client-side JavaScript to learn the details of the failure, so we have to make do with limited information.

    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • ReverseProxySetupMonitor

        public ReverseProxySetupMonitor()
    • Method Detail

      • isActivated

        public boolean isActivated()
        Description copied from class: AdministrativeMonitor
        Returns true if this monitor is activated and wants to produce a warning message.

        This method is called from the HTML rendering thread, so it should run efficiently.

        Specified by:
        isActivated in class AdministrativeMonitor
      • doTest

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        @RestrictedSince("2.235")
        public org.kohsuke.stapler.HttpResponse doTest​(org.kohsuke.stapler.StaplerRequest request,
                                                       @QueryParameter
                                                       boolean testWithContext)
      • getTestForReverseProxySetup

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        @RestrictedSince("2.235")
        @StaplerDispatchable
        public void getTestForReverseProxySetup​(String rest)
      • doAct

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        @RestrictedSince("2.235")
        public org.kohsuke.stapler.HttpResponse doAct​(@QueryParameter
                                                      String no)
                                               throws IOException
        Depending on whether the user said "yes" or "no", send him to the right place.
        Throws:
        IOException