public class ApacheProxyAddressStrategy extends IncomingRequestAddressStrategy
IncomingRequestAddressStrategy unless there's an x-forwarded-host present, in which case that's used in place of the server's address.
If the Apache Http Server mod_proxy isn't configured to supply x-forwarded-proto, the factory method that you use to create the address strategy will determine the default. Note that
mod_proxy doesn't set this by default, but it can be configured via RequestHeader set X-Forwarded-Proto http (or https)
If you want to set the protocol based on something other than the constructor argument, you should be able to do so by overriding protocol.
Note that while this strategy was designed to work with Apache Http Server, and has been tested against it, it should work with any proxy server that sets x-forwarded-host
Created by Bill de Beaubien on 3/30/2015.| Modifier | Constructor and Description |
|---|---|
protected |
ApacheProxyAddressStrategy(boolean theUseHttps) |
| Modifier and Type | Method and Description |
|---|---|
String |
determineServerBase(javax.servlet.ServletContext theServletContext,
javax.servlet.http.HttpServletRequest theRequest)
Determine the server base for a given request
|
static ApacheProxyAddressStrategy |
forHttp() |
static ApacheProxyAddressStrategy |
forHttps() |
String |
forwardedServerBase(javax.servlet.ServletContext theServletContext,
javax.servlet.http.HttpServletRequest theRequest,
String theForwardedHost) |
protected String |
protocol(javax.servlet.http.HttpServletRequest theRequest) |
determineServletContextPath, setServletPathprotected ApacheProxyAddressStrategy(boolean theUseHttps)
public static ApacheProxyAddressStrategy forHttp()
public static ApacheProxyAddressStrategy forHttps()
public String determineServerBase(javax.servlet.ServletContext theServletContext, javax.servlet.http.HttpServletRequest theRequest)
IServerAddressStrategydetermineServerBase in interface IServerAddressStrategydetermineServerBase in class IncomingRequestAddressStrategypublic String forwardedServerBase(javax.servlet.ServletContext theServletContext, javax.servlet.http.HttpServletRequest theRequest, String theForwardedHost)
Copyright © 2014–2016 University Health Network. All rights reserved.