Maven nexus with jetty 7 and apache2 reverse proxy
Posted
by
user613154
on Stack Overflow
See other posts from Stack Overflow
or by user613154
Published on 2011-02-11T14:22:08Z
Indexed on
2011/02/11
15:25 UTC
Read the original article
Hit count: 457
Hello stackoverflow !
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 :
I made a jetty context file as follow : {jetty.home}/contexts/nexus.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/nexus</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/nexus.war</Set>
</Configure>
My jetty connector in jetty.xml is as follow :
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="forwarded">true</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
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
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
<VirtualHost *:80>
ServerName maven.foo.com
ProxyPass / http://localhost:8080/nexus/
ProxyPassReverse / http://localhost:8080/nexus/
ErrorLog ${APACHE_LOG_DIR}/error_nexus.log
</VirtualHost>
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
© Stack Overflow or respective owner