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();
contextHandler.setContextPath("/");
server.setHandler(contextHandler);


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
https://www.eclipse.org/jetty/documentation/current/configuring-fastcgi.html
Then you might like to look at the working embedded example of the
FastCGIProxyServlet in the Jetty test code.
https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServletTest.java

Cheers,
Lachlan


On Thu, Jun 18, 2020 at 3:19 AM Ryan smith <[email protected]> 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();
> server.setHandler(handler);
>
> //Setup proxy servlet
> ServletContextHandler context = new ServletContextHandler(handler, "/");
> ServletHolder proxyServlet = new ServletHolder(FastCGIProxyServlet.class);
> proxyServlet.setInitParameter("proxyTo", "http://127.0.0.1:2005";);
> 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?
>
> Thanks,
> Ryan
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to