【问题标题】:Maven nexus with jetty 7 and apache2 reverse proxyMaven nexus 与 jetty 7 和 apache2 反向代理
【发布时间】:2011-02-11 14:22:08
【问题描述】:

这是我的问题:我尝试在 apache 反向代理后面运行 maven nexus。由于我的码头有多次战争,我希望联系在这里运行:

http://localhost:8080/nexus

我制作了一个码头上下文文件如下:{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>

jetty.xml 中的码头连接器如下:

<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>

我希望http://maven.foo.com/ 作为连接的终点,所以我制作了这个 apache2 配置文件:

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>

但我无法让它工作。浏览器中显示的错误消息是“服务器没有找到与请求 URI 匹配的任何内容”。我试图阅读 jetty 和 apache 网站上的文档,但没有找到将子域“sub.foo.com”映射到上下文“localhost:8080/sub”的信息......

欢迎任何帮助!谢谢

【问题讨论】:

    标签: apache2 maven jetty reverse-proxy nexus


    【解决方案1】:

    在 Jetty 中,您可以按照这些说明将特定的网络应用程序配置为特定子域上的根(默认)应用程序

    如果您这样做,那么您的 Apache 代理配置应该会变得非常简单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-13
      • 2015-05-28
      • 1970-01-01
      • 1970-01-01
      • 2016-11-03
      • 2021-03-11
      • 2011-11-25
      • 1970-01-01
      相关资源
      最近更新 更多