Jenkins Location -> Jenkins URL with a port number

We allow access to Jenkins [2.361.4] externally via an SSH tunnel with NGINX in the way to enforce certificate-based client authentication over HTTPS. Because of the remote SSH tunnel, the port number for HTTPS access has to be greater than 1024 (we can’t just use 443) and it is not a bad idea to choose a pretty random number for additional obfuscation; lets say we choose 8888.

Hence the configuration item Jenkins LocationJenkins URL, to have the correct URL for SSH access, now has a port number on the end: https://myurl.com:8888/.

The problem is that this doesn’t seem to work in most places in the web interface: for instance, if I hover over the Manage Jenkins item in the left-hand menu, the link the browser says it is going to go to is https://myurl.com:8888/manage but when you click on the link where it actually tries to go to is https://myurl.com/manage. I’ve tried this in both Firefox and Chrome so it does not appear to be a browser thing.

Some links seem to be correct: for instance selecting System ConfigurationConfigure System works but SecurityConfigure Global Security doesn’t. All of them look as though they are going to work from the hover information, but only a few of them do, and the same is true of the redirect once you’ve entered your password from the login page it tries to take you to https://myurl.com instead of https://myurl.com:8888, which doesn’t make for the best user experience; FYI all the Blue Ocean links seem to work OK.

What might I be doing wrong? How is this meant to work? Could this be an artefact of the SSH tunnel (8888 at the “public” end, tunneling to 443 at NGINX)?

Seems that it was indeed the SSH remote tunnel: if I switch NGINX and the local-end of the remote SSH tunnel to be 8888, like the public-end, the problem goes away. I will leave it so.

1 Like

Thanks a lot for your feedback @RobMeades :pray: