First let me note that I've seen this question here before, but never with an answer that actually works.
Here is the issue: I have a Jenkins server running on 8080 (Ubuntu 14.04). I'm trying to port it to [domain]/ci/. While this is fairly simple thing, and it dose work, most of the links are still going to the root, that is [domain], thus rendering the server unapproachable from that address. I have tried all kind of options with
proxy_redirect http://$host/ http://$host/ci/;
With the port or without it, full host name, localhost... you name it. Nothing. Links are still going to the root of the server, so many links, all the images and the scripts are unavailable.
hereby is the ci section in the configuration file. would LOVE some input on that, it just won't work.
location /ci/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect http://$host/ http://$host/ci/;
}
Running
curl -I [domain]/ci
Returns
Location: http://[domain]/ci/
But it doesn't work. This might very well be Jenkins fault, as the links are all following root (e.g <link rel="stylesheet" type="text/css" href="/static/15751a6d/css/style.css" />
) , but I still believe that I'm missing something.