Class FastCGIProxyServlet

All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class FastCGIProxyServlet extends 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:
  • Field Details

  • Constructor Details

    • FastCGIProxyServlet

      public FastCGIProxyServlet()
  • Method Details

    • init

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

      protected HttpClient newHttpClient()
      Description copied from class: AbstractProxyServlet
      The servlet init parameter 'selectors' can be set for the number of selector threads to be used by the HttpClient.
      Overrides:
      newHttpClient in class AbstractProxyServlet
      Returns:
      a new HttpClient instance
    • sendProxyRequest

      protected void sendProxyRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest)
      Overrides:
      sendProxyRequest in class AbstractProxyServlet
    • customizeFastCGIHeaders

      protected void customizeFastCGIHeaders(Request proxyRequest, HttpFields.Mutable fastCGIHeaders)