YUM repo URL is wrong

Hi,
I have a setup where everything runs in containers: nginx reverse proxy, nxrm3, my rpm builder, my deb builder, jenkins, etc.

I’m running v3.37.0

The reverse proxy, in regards to NXRM is quite simple:
I connect (https) to nexus:1808 (where nginx is listening), it forwards the traffic to the Nexus container on tcp/2937 (http); NXRM listens http on that port, the UI works just fine.

For the docker registry, the revere proxy listens on http to nexus:9820 and forwards to the Nexus container on http: nexus:5000

I haven’t tested the docker part, yet.

Now, when I try to configure a YUM repo, I go through its config, everything looks fine.

I click on the newly-created yum repo, it shows that its URL will be:
http://nexus/repository/dnfLocal (its name).

I was expecting:
https://nexus:1808/repository/dnfLocal/

Why does it select such an URL ? Nothing should listen on tcp/80 in the reverse proxy container or the nexus container.

Is there a way to change this, somewhere ?
I did not find any reverse proxy example, I went by ear. Any guidance, if it’s where I’ve faulted ?

Thanks

Hi J.F.,

Why does it select such an URL ? Nothing should listen on tcp/80 in the reverse proxy container or the nexus container.

Does the link work or not? How did you configure the port 1808 - was it via editing nexus.properties? If the link doesn’t work it might be a bug on our side - if so, please file a bug report in our JIRA.

Is there a way to change this, somewhere ?

No, the displayed IRLs are not customisable.

Good morning, @dsawa; sorry my post was not so explicit, new users are limited on writing no more than 2 URLs in a post, so I kind of “paraphrased” the URLs where I could.

My setup is this:

  • an nginx reverse proxy container that listens on port 1808 (https) and forwards traffic to a container named nexus.xxx.yyy in http on port 2937. That port is well-defined in nexus.properties, it works just fine, as I get the UI.
  • the reverse proxy also listens on port 9820 (https), and the traffic is also forwarded to nexus on port 5000 (http); this will be my docker registry; I’ll configure it once I get the YUM repo up and running.

All of those containers are hosted on the same box, an Asustor AS6604T NAS.

Late last night I’ve found an nginx reverse proxy example on sonatype.com, it did not differ much from what I have, but I’ll be testing it today to see if the error was in the reverse-proxy config or not. If so, I will let you know.

Basically, in my browser, if I type Nexus’s URL, it gets directed to nginx, which forwards it to the nexus container, keeping the fqdn + port number as I’ve entered them in the browser… just like any

I’ve provided my nginx reverse proxy config for Nexus at nexus reverse proxy config (/etc/nginx/http.d/nexus.conf) · GitHub

I’m aware that NginX is out of your scope, I’m providing this as a reference, so you’ll see more clearly there how I’m configured.

–JFG

You need to let Nexus Repo know what port is being used on the public URL. To do that in nginx, add this to the configuration:

proxy_set_header proxy_set_header X-Forwarded-Port 1808;

Also, since you are using a reverse proxy you should not make a connector port in the docker repository. Connector ports add overhead, and should only be used if a reverse proxy is not used.

Pass directly to the repository URL over the main Nexus Repo application port:

proxy_pass [http://localhost:8081/repository/docker-repo/](http://locahost:8081/repository/docker-repo)```

Thanks @rseddon. The sample config I had found on your help did not mention port-forwarding :
https://help.sonatype.com/repomanager2/installing-and-running/running-behind-a-reverse-proxy
(I’m aware that the URL mentions NXRM2, but I assume that the nginx config should not change regardless of the back-end).

I keep note of your comment about the registry’s endpoint as well.

Sorry for the late reply, it has been a busy week.

Unfortunately, @rseddon, even with your addition in the nginx config (see new gist: nginx reverse proxy config for a nexus yum repo · GitHub),

The NXRM url for a yum repo still points (http) to $MYDOMAIN:80/repository/repo-name instead of (http) $MYDOMAIN:1808/repository/repo-name.

Is there something else that I might be missing ?

To recap:

  • the nexus container UI listens on tcp 2937
  • an nginx reverse proxy container listens on https port 1808 and forwards to the nexus container on http 2937

At this point, unless we can show that I had missed something, could it be considered a bug/issue ? If so, where should I file the ticket (JIRA, github, etc) ?

image

The URL above should have the port 1808, no ?