Failed to Setup Npm Proxy to Connect to Remote Npm Storage Through a Proxy

I have been working for a week on a npm proxy in nexus (version: OSS 3.47.1-01) that connects to a remote npm storage behind a proxy server, and I still failed to make it work. Here is the network topology:

| <----------------inner network---------------------> | <----------outer network----------> |
MyComputer <----> Nexus (Npm Proxy) <----> (10205) Proxy Server <----> (80) Remote Npm Storage

The port configured in the Proxy Server for redirecting npm requests is 10205, and the Proxy Server should redirect all the npm requests to port 80 of the Remote Npm Storage. When configuring the Npm Proxy in Nexus (through a website frontend), the Remote storage field is set to http://ProxyServer:10205/aa/bb/cc. But when I try to use My Computer to pull packages from Remote Npm Storage, e.g. by npm install, I find that Nexus sends fetch requests to port 80 of the Proxy Server instead of port 10205. For examples, it is expected that the Npm Proxy in Nexus sends requests to http://ProxyServer:10205/aa/bb/cc/xyz.tgz to pull xyz.tgz, but it actually send the requests to http://ProxyServer:80/aa/bb/cc/xyz.tgz, which leads to connection failure.

I have no idea what cased the port changed.

I have tried two different workarounds that can make things work:

  1. Change the configured port of Proxy Server to 80: When configuring the Npm Proxy in Nexus, the Remote storage is set to http://ProxyServer:80/aa/bb/cc. In that case, I can download npm packages in My Computer through Nexus.

  2. Bypass Nexus: I also tried connecting directly to Remote Npm Storage via Proxy Server, while bypassing nexus. Here are the settings in my .npmrc file:

registry = http://RemoteNpmStorage:80/aa/bb/cc
proxy = http://ProxyServer:10205
https-proxy = http://ProxyServer:10205

In that case, I can also download npm packages in My Computer through Nexus. One interesting finding is that, if I set registry in the .npmrc file to the Proxy Server, I get the same problem (i.e., port changed) as the one when using Nexus:

registry = http://ProxyServer:10205/aa/bb/cc

Besides, a third workaround that might work is that: 1) I set the Remote storage of the Npm Proxy to http://RemoteNpmStorage:80/aa/bb/cc; and 2) I add some repository-specific proxy settings such that the Npm Proxy could communicate with the Remote Npm Storage through http://ProxyServer:10205. What I can find in Nexus frontend is that, under Administration > System > HTTP > ProxySetting, we can change the proxy settings for the entire Nexus. However, the Npm Proxy is not the only repository in Nexus, I cannot change the global proxy settings as that affects all the repositories in Nexus.

Any help or hint would be highly appreciated. Thanks!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật