Class FastCGIProxyServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.eclipse.jetty.proxy.AbstractProxyServlet
org.eclipse.jetty.proxy.ProxyServlet
org.eclipse.jetty.proxy.AsyncProxyServlet
org.eclipse.jetty.proxy.AsyncProxyServlet.Transparent
org.eclipse.jetty.fcgi.server.proxy.FastCGIProxyServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class FastCGIProxyServlet extends org.eclipse.jetty.proxy.AsyncProxyServlet.Transparent
Specific implementation of AsyncProxyServlet.Transparent for FastCGI.

This servlet accepts an 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 these 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 parameter
  • scriptPattern, optional, defaults to (.+?\.php), that specifies a regular expression with at least 1 and at most 2 groups that specify respectively:
    • the FastCGI SCRIPT_NAME parameter
    • the FastCGI PATH_INFO parameter
  • fastCGI.HTTPS, optional, defaults to false, that specifies whether to force the FastCGI HTTPS parameter to the value on
  • fastCGI.envNames, optional, a comma separated list of environment variable names read via System.getenv(String) that are forwarded as FastCGI parameters.
  • unixDomainPath, optional, that specifies the Unix-Domain path the FastCGI server listens to.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AsyncProxyServlet

    org.eclipse.jetty.proxy.AsyncProxyServlet.StreamReader, org.eclipse.jetty.proxy.AsyncProxyServlet.StreamWriter, org.eclipse.jetty.proxy.AsyncProxyServlet.Transparent

    Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.ProxyServlet

    org.eclipse.jetty.proxy.ProxyServlet.ProxyInputStreamRequestContent, org.eclipse.jetty.proxy.ProxyServlet.ProxyResponseListener

    Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

    org.eclipse.jetty.proxy.AbstractProxyServlet.TransparentDelegate
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

    _log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    customizeFastCGIHeaders(org.eclipse.jetty.client.api.Request proxyRequest, org.eclipse.jetty.http.HttpFields.Mutable fastCGIHeaders)
     
    void
     
    protected org.eclipse.jetty.client.HttpClient
     
    protected void
    sendProxyRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse proxyResponse, org.eclipse.jetty.client.api.Request proxyRequest)
     

    Methods inherited from class org.eclipse.jetty.proxy.AsyncProxyServlet.Transparent

    init, rewriteTarget

    Methods inherited from class org.eclipse.jetty.proxy.AsyncProxyServlet

    newReadListener, newWriteListener, onResponseContent, proxyRequestContent

    Methods inherited from class org.eclipse.jetty.proxy.ProxyServlet

    newProxyResponseListener, onContinue, service

    Methods inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

    addProxyHeaders, addViaHeader, addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, filterServerResponseHeader, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, newClientConnector, newHttpClient, newProxyRequest, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, sendProxyResponseError, setTimeout, validateDestination

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service

    Methods inherited from class jakarta.servlet.GenericServlet

    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FastCGIProxyServlet

      public FastCGIProxyServlet()
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class org.eclipse.jetty.proxy.AbstractProxyServlet
      Throws:
      jakarta.servlet.ServletException
    • newHttpClient

      protected org.eclipse.jetty.client.HttpClient newHttpClient()
      Overrides:
      newHttpClient in class org.eclipse.jetty.proxy.AbstractProxyServlet
    • sendProxyRequest

      protected void sendProxyRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse proxyResponse, org.eclipse.jetty.client.api.Request proxyRequest)
      Overrides:
      sendProxyRequest in class org.eclipse.jetty.proxy.AbstractProxyServlet
    • customizeFastCGIHeaders

      protected void customizeFastCGIHeaders(org.eclipse.jetty.client.api.Request proxyRequest, org.eclipse.jetty.http.HttpFields.Mutable fastCGIHeaders)