Maven nexus with jetty 7 and apache2 reverse proxy

Maven nexus with jetty 7 and apache2 reverse proxy

Here is my problem : i try to run a maven nexus behind an apache reverse proxy. As i have multiples war in my jetty, i want the nexus to run here :
http://localhost:8080/nexus
I made a jetty context file as follow : {jetty.home}/contexts/nexus.xml

/nexus
/webapps/nexus.war

My jetty connector in jetty.xml is as follow :





300000
2
true
false
8443
20000
5000


I want http://maven.foo.com/ as an end point for the nexus, so i made this apache2 configuration file :
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On


AddDefaultCharset off
Order deny,allow
Allow from all


ServerName maven.foo.com

ProxyPass / http://localhost:8080/nexus/
ProxyPassReverse / http://localhost:8080/nexus/

ErrorLog ${APACHE_LOG_DIR}/error_nexus.log

But i can’t manage to make it work. The error message displayed in the browser is “The server has not found anything matching the request URI”. I tried to read docs on jetty and apache web site, but didn’t find information for mapping a subdomain “sub.foo.com” to a context “localhost:8080/sub” …
Any help welcome ! Thanks

Solutions/Answers:

Solution 1:

In Jetty you can configure a particular web-app to be served as the root (default) application on a particular sub-domain by following these instructions

If you do that, then your Apache proxy config should become pretty simple.

References

Related:  Combining ASP.NET MVC and Reverse Proxy with URL Rewrite v2