Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Getting FastCGI response back from FastCGI application

Hi Ryan,

Firstly I don't think you need the initial ServletHandler you are using, you could instead add the ServletContextHandler onto the server directly.
ServletContextHandler contextHandler = new ServletContextHandler();

I'm not an expert on FastCGI but maybe I can help. Are you sure your script root is correct? I think it should be a path but it looks like a package name.

Other than that, if you've already read and understood the documentation at
Then you might like to look at the working embedded example of the FastCGIProxyServlet in the Jetty test code.


On Thu, Jun 18, 2020 at 3:19 AM Ryan smith <ryanesmith899@xxxxxxxxx> wrote:
I am new to Jetty and am trying to configure an Embedded Jetty web server to do FastCGI.

My Jetty Web Server configuration is as follows:

Server server = new Server(SERVERPORT);

ServletHandler handler = new ServletHandler();

//Setup proxy servlet
ServletContextHandler context = new ServletContextHandler(handler, "/");
ServletHolder proxyServlet = new ServletHolder(FastCGIProxyServlet.class);
proxyServlet.setInitParameter("proxyTo", "");
proxyServlet.setInitParameter("prefix", "/");
proxyServlet.setInitParameter("scriptRoot", "com.example.myapplication");

context.addServlet(proxyServlet, "/*");

It is able to send the HTTP request to my FastCGI application but I am unable to get the response from my FastCGI application.

I am also getting an error on my FastCGI application because I have not flushed the outputstream. 

My FastCGI application works with a lighttpd web server but not with this Jetty Server so I believe it has to do with the way the Jetty Server is configured. Any help?


jetty-users mailing list
To unsubscribe from this list, visit

Back to the top