1
votes

We have 2 Nexus SSO servers with NuGet proxy repositories. One is in our private network environment (v3.0.0), the other is within the DMZ (v3.0.1) with internet access.

A request first gets sent to the private Nexus server that forwards the request to the Nexus server in the DMZ, which in turn forwards the request to the outside nuget.org repository. So basically:

client -> private proxy -> dmz proxy -> internet.

Using this method, the client get's an error Unable to find package. From the logs on the private proxy, I see that it forwards the request to the dmz proxy as http://dmzproxy/repository/NuGetRepository/FindPackagesById?id='angularjs' but receives a 404 not found.

Troubleshooting the issue, I tried to bypass the private proxy by running nuget.exe straight from that server, which would be:

client -> dmz proxy -> internet

This method actually works, and from using nuget.exe with -Verbosity detailed, I can see that nuget.exe sends a slightly different request to the dmz proxy than the private proxy does:

http://dmzproxy/repository/NuGetRepository/FindPackagesById()?id='angularjs'

Compare that with the request sent by Nexus, you can see that the difference is the parentheses () after FindPackagesById. So, for testing, I copy/pasted both request URL's in a browser window and indeed, without parentheses I get a 404, with parentheses I get a package feed page.

So, Nexus does work with parentheses when serving NuGet, but doesn't seem to apply them when forwarding a request to another Nexus server, causing a 404 reponse.

1

1 Answers

1
votes

After further testing and contact with SonaType support, I've found that Nexus 3.0.0 and 3.0.1 indeed don't support request with FindPackagesById? without the parentheses, even though that is exactly the way Nexus itself forwards requests.

The latest Nexus version (currently 3.2.1), while still forwarding requests without parentheses, does support both ways. So, updating all Nexus servers to the latest version should solve this issue.

Within this particular organization updating is easier said than done. So in the meantime, I have configured a reverse proxy with a rewrite rule, that forwards request from the private Nexus server to the Nexus server in DMZ and rewrites "FindPackagesById?" to "FindPackagesById()?". Not an ideal situation but a working temporary solution until all Nexus servers are updated.