I want to run two web server at the same port. I know you can do this with tomcat and apache for entire domains. But what I'm looking for is a way for jetty to forward traffic to a specific directory to grunt. for example


This is handled by jetty


This is handled by grunt and all other request to pages under frontend. The reason I'm doing this is that we use different server for frontend and backend development and i don't want request to rest services from the front end to be calls to an other domain.


By definition, only a single process can listen on any given port.

That said, you can achieve what you're asking for with a reverse proxy (mod_proxy, HAProxy, nginx, lighttpd).

You'd have to change your web server and jetty listen on other ports (8080 and 8081 for example), have the proxy listen on the "default" port (probably 80 or 443 in this case) and then have it forward the requests to the approprate backend based on the criteria you've listed (URL path starting with /frontend).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.