2013-09-29 82 views
4

我们正在运行Sonatype的Nexus来存储我们的所有版本,缓存我们的依赖关系等等。但是,我想从默认安装的端口8081 URL移开,而不是通过Apache代理通过SSL托管它。我已经设置了Apache的mod_proxy来代理它,这样https://myserver.com/nexus带来了Nexus。我用下面的配置指令我的虚拟主机配置的内部:Sonatype Nexus:使用Apache的SSL代理

# Configure mod_proxy to be used for proxying URLs on this site to other URLs/ports on this server. 
ProxyRequests Off 
ProxyVia Off 
ProxyPreserveHost On 
<Proxy *> 
    AddDefaultCharset off 
    Order deny,allow 
    Allow from all 
</Proxy> 

# Proxy the Sonatype Nexus OSS web application running at http://localhost:8081/nexus 
<Location /nexus> 
    ProxyPass http://localhost:8081/nexus 
    ProxyPassReverse http://localhost:8081/nexus 
</Location> 

这似乎在Running Nexus Behind a Proxy匹配的说明。但是,我无法清除Nexus中的“基本网址”设置:它不会让我留下空白。

而一切主要作品:我可以在HTTPS URL访问Nexus,登录并执行大多数GUI功能。

然而,在登录时,我得到以下警告消息:

WARNING: Base URL setting of http://myserver.com/nexus does not match your actual URL! If you're running Apache mod_proxy, here's more information on configuring Nexus with it.

而不是一切在GUI中的实际工作。到目前为止,我已经注意到以下几点:

  • 系统供稿:提供了以下错误:

    Problem accessing /nexus/service/local/feeds. Reason:

    The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request

    Nexus returned an error: ERROR 406: The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request

  • Deleting Hosted Repositories: I went through and deleted several empty & unneeded repositories. However, after confirming the deletions, only the first was removed. I had to login to the 8081 site to delete any of the others.

回答

4

你只需要调整在管理 - >服务器配置屏幕中的baseUrl设置。设置您使用的网址,然后点击强制基地址选项。

+0

Brian:谢谢!我试着将基本网址设置为完整的“https”地址,该地址没有起作用。然而,启用**强制URL **与此相关。 –

+1

Sonatype当前的文档指出,Force Base URL复选框的初始意图不再是有效的用例,并且可能会导致问题。但是,基本URL字段仍然看起来像是进行更改的地方。 http://books.sonatype.com/nexus-book/reference/install-sect-proxy.html –

1

documentation,它看起来像一个更好的解决方案可能是一个RequestHeader添加到Apache配置:

RequestHeader set X-Forwarded-Proto "https" 

我试图接受的答案,这似乎工作,但一旦我添加了RequestHeader,我能够取消选中强制URL并且清除了警告。尽管如此,我还没有测试OP描述的其他行为。

+0

这些应该是被接受的答案! 感谢您指出,因为我第一次阅读文档时错过了它。 – Julien

相关问题