The href of the "New View" link in the left panel is constructed differently from the other links and is an absolute URL rather than a relative URL.
I've only noticed this issue because our Jenkins server is setup inside a VPN. So we VPN into the university and then SSH to our gateway machine. Thus we use two domain name variants to access Jenkins depending on whether the user is in the lab (thus using "jenkins.int") or outside the lab (thus using "jenkins.vpn").
The consequence of this is that when an external user accesses the Jenkins server via VPN/SSH using "jenkins.vpn", the "New View" link points to "jenkins.int/newView" instead of "jenkins.vpn/newView". This means that external users get a 404 error (Server not found) and need to manually correct the url. (Minor/trivial bug.)
In core/src/main/java/jenkins/model/NewViewLink.java, starting line 45
@Override public String getUrlName() { String urlName = Jenkins.getInstance().getRootUrl() + URL_NAME; return urlName; }
the class prepends Jenkins.getInstance().getRootUrl() to URL_NAME. If "/" is prepended instead, urlName becomes a relative address, and the "New View" link is fixed.
As I am not familiar with the Jenkins codebase, I'm not sure if this is the right way to fix this problem.
- is related to
-
JENKINS-60106 My views 'new view' links to not authorized top 'new view' editor
- Open