hudson.diagnosis
Class ReverseProxySetupMonitor

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.AdministrativeMonitor
          extended by hudson.diagnosis.ReverseProxySetupMonitor
All Implemented Interfaces:
ExtensionPoint, ModelObject, SearchableModelObject, SearchItem

@Extension
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 doFoo(), 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.AdministrativeMonitor
id
 
Constructor Summary
ReverseProxySetupMonitor()
           
 
Method Summary
 org.kohsuke.stapler.HttpResponse doAct(String no)
          Depending on whether the user said "yes" or "no", send him to the right place.
 FormValidation doFoo()
           
 org.kohsuke.stapler.HttpResponse doTest()
           
 boolean isActivated()
          Returns true if this monitor is activated and wants to produce a warning message.
 
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getDisplayName, getSearchUrl, getUrl, isEnabled
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

public org.kohsuke.stapler.HttpResponse doTest()

doFoo

@WebMethod(name="test-for-reverse-proxy-setup")
public FormValidation doFoo()

doAct

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


Copyright © 2004-2013. All Rights Reserved.