public class FastCGIProxyServlet extends AsyncProxyServlet.Transparent
AsyncProxyServlet.Transparent
for FastCGI.
This servlet accepts a HTTP request and transforms it into a FastCGI request
that is sent to the FastCGI server specified in the proxyTo
init-param.
This servlet accepts two additional init-params:
scriptRoot
, mandatory, that must be set to the directory where
the application that must be served via FastCGI is installed and corresponds to
the FastCGI DOCUMENT_ROOT parameterscriptPattern
, optional, defaults to (.+?\.php)
,
that specifies a regular expression with at least 1 and at most 2 groups that specify
respectively:
fastCGI.HTTPS
, optional, defaults to false, that specifies whether
to force the FastCGI HTTPS
parameter to the value on
TryFilesFilter
,
Serialized FormModifier and Type | Class and Description |
---|---|
private class |
FastCGIProxyServlet.ProxyHttpClientTransportOverFCGI |
AsyncProxyServlet.StreamReader, AsyncProxyServlet.StreamWriter, AsyncProxyServlet.Transparent
ProxyServlet.ProxyInputStreamContentProvider, ProxyServlet.ProxyResponseListener
AbstractProxyServlet.TransparentDelegate
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FASTCGI_HTTPS_INIT_PARAM |
private boolean |
fcgiHTTPS |
static java.lang.String |
ORIGINAL_QUERY_ATTRIBUTE_INIT_PARAM |
static java.lang.String |
ORIGINAL_URI_ATTRIBUTE_INIT_PARAM |
private java.lang.String |
originalQueryAttribute |
private java.lang.String |
originalURIAttribute |
private static java.lang.String |
REMOTE_ADDR_ATTRIBUTE |
private static java.lang.String |
REMOTE_PORT_ATTRIBUTE |
private static java.lang.String |
REQUEST_QUERY_ATTRIBUTE |
private static java.lang.String |
REQUEST_URI_ATTRIBUTE |
private static java.lang.String |
SCHEME_ATTRIBUTE |
static java.lang.String |
SCRIPT_PATTERN_INIT_PARAM |
static java.lang.String |
SCRIPT_ROOT_INIT_PARAM |
private java.util.regex.Pattern |
scriptPattern |
private static java.lang.String |
SERVER_ADDR_ATTRIBUTE |
private static java.lang.String |
SERVER_NAME_ATTRIBUTE |
private static java.lang.String |
SERVER_PORT_ATTRIBUTE |
_log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERS
Constructor and Description |
---|
FastCGIProxyServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
customizeFastCGIHeaders(Request proxyRequest,
HttpFields fastCGIHeaders) |
void |
init() |
protected HttpClient |
newHttpClient()
The servlet init parameter 'selectors' can be set for the number of
selector threads to be used by the HttpClient.
|
protected void |
sendProxyRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse proxyResponse,
Request proxyRequest) |
init, rewriteTarget
newReadListener, newWriteListener, onResponseContent, proxyRequestContent
newProxyResponseListener, onContinue, service
addProxyHeaders, addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, filterServerResponseHeader, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, sendProxyResponseError, setTimeout, validateDestination
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public static final java.lang.String SCRIPT_ROOT_INIT_PARAM
public static final java.lang.String SCRIPT_PATTERN_INIT_PARAM
public static final java.lang.String ORIGINAL_URI_ATTRIBUTE_INIT_PARAM
public static final java.lang.String ORIGINAL_QUERY_ATTRIBUTE_INIT_PARAM
public static final java.lang.String FASTCGI_HTTPS_INIT_PARAM
private static final java.lang.String REMOTE_ADDR_ATTRIBUTE
private static final java.lang.String REMOTE_PORT_ATTRIBUTE
private static final java.lang.String SERVER_NAME_ATTRIBUTE
private static final java.lang.String SERVER_ADDR_ATTRIBUTE
private static final java.lang.String SERVER_PORT_ATTRIBUTE
private static final java.lang.String SCHEME_ATTRIBUTE
private static final java.lang.String REQUEST_URI_ATTRIBUTE
private static final java.lang.String REQUEST_QUERY_ATTRIBUTE
private java.util.regex.Pattern scriptPattern
private java.lang.String originalURIAttribute
private java.lang.String originalQueryAttribute
private boolean fcgiHTTPS
public void init() throws javax.servlet.ServletException
init
in class AbstractProxyServlet
javax.servlet.ServletException
protected HttpClient newHttpClient()
AbstractProxyServlet
newHttpClient
in class AbstractProxyServlet
protected void sendProxyRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest)
sendProxyRequest
in class AbstractProxyServlet
protected void customizeFastCGIHeaders(Request proxyRequest, HttpFields fastCGIHeaders)