Can stand-alone Jetty be used as a reverse proxy (

2019-04-25 11:17发布

问题:

I have an application which includes a Jetty web server that we distribute to multiple user to deploy on their servers. Based on some new requirements, we need to include reverse proxy capabilities. The Jetty documentation talks about using Apache as the reverse proxy in front of Jetty. While this works, it would be much easier to just use Jetty and not have to carry around Apache. Is there any way to configure standalone Jetty as a reverse proxy?

回答1:

Sure you should be able to use the ProxyServlet which is fully async and quite customizable if needed:

http://www.eclipse.org/jetty/documentation/current/proxy-servlet.html