通过Nexus 3.2代理通过范围划分的NPM项目

Bri*_*ing 1 nexus npm nexus3

目前,我一直在设置Nexus 3.2,尤其是NPM存储库。我有一个代理存储库,指向registry.npmjs.org我已成功发布到同一实例上的托管存储库,以及使用实例通过组存储库下载工件npm update -g

不幸的是,通过该小组下载范围内的项目无法正常工作,这对于进行Angular 2开发至关重要。当我尝试时,出现404错误:

brian$ npm install "@angular/common"
npm ERR! registry error parsing json
npm ERR! Unexpected token < in JSON at position 0
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /nexus/repository/npm_group/@angular/common was not found on this server.</p>
npm ERR! </body></html>
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/brian/.npm/_logs/2017-03-28T07_38_37_824Z-debug.log
Run Code Online (Sandbox Code Playgroud)

范围是3.x的高度吹捧的功能,我很高兴它们可以正常工作。因为我可以发布到受保护的存储库,并且代理存储库中充满了非范围内的依赖项,所以我认为我已经非常接近了。我该如何调试?

FWIW,我在Apache HTTPd服务器后面有Nexus:

ProxyPass /nexus http://dev.example.com:8081/nexus nocanon
ProxyPassReverse /nexus http://dev.example.com:8081/nexus
  AllowEncodedSlashes On
<Location /nexus>
  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-Port "443"
</Location>
Run Code Online (Sandbox Code Playgroud)

谢谢!

Bri*_*ing 5

解决了这个SO答案涵盖了使用的细微差别AllowEncodedSlashes

错误46830:如果在全局上下文中设置AllowEncodedSlashes On,则虚拟主机不会继承它。您必须在每个容器中显式设置AllowEncodedSlashes On。

由于具有上述配置,因此AllowEncodedSlashes在我具有错误的范围中添加,因此需要将其放置在VirtualHostSSL 的范围中。就我而言,那是NSS模块(因为我有由FreeIPA更新的证书)。

一旦更改,一切都会很好。