Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running Jenkins standalone (The WAR file, java -war ./jenkins.war or whatever the command is) listening on a non-standard port. I want to get NGINX to proxy from our HTTPS site /jenkins/ to this standalone.

location /jenkins/ {
    proxy_pass http://axolotl.ecogeek.local:10112/;

Problem is, Jenkins still things it's at the root URL so all requests are relative to that, so when accessing /jenkins/ it redirects to /login but it needs to go to /jenkins/login, is there any way, through Jenkins or through NGINX, to change the root URL and get it to play nice?


Connecting to Jenkins on it's normal port I can go to Manage Jenkins->Configure System->Jenkins URL and change that, that fixes the redirection but all the media is being requested from /static/ (Have tried restarting Jenkins)

share|improve this question
up vote 2 down vote accepted

When you go into the Jenkins control panel, you will see a "Manage Jenkins" link. Somewhere down that page, you'll see "Jenkins URL". Try setting that to or whatever scheme you have.

Take a look at:

So, Jenkins is apparently stupid about some things, and you'll need rewrites.

share|improve this answer
Thanks, just found that (see edit) but the static stuff is still coming from /static/ =( – Smudge Mar 10 '12 at 15:17
@sam See update – cjc Mar 10 '12 at 15:24

Try making a 301 redirect from / to /jenkins/ (be sure to carry the request data over).

share|improve this answer
There is other stuff at / I can't remove – Smudge Mar 10 '12 at 15:09
Your solution will fail if the OP wants to have other stuff in / – cjc Mar 10 '12 at 15:11
Yes, true. Jenkins is a pain to get working through proxies, because it is written in a way that takes files relatively TO THE DOMAIN but not to the directory. – ionFish Mar 10 '12 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.