Youtrack behind nginx on a different domain


I'm trying to set up YouTrack that is installed on a different machine with nginx. I managed to do this with rundeck that is also on a different domain.

When I go to,
browser redirects me to , 
so I think I'd need to change the base URL, but I already have users sitting on youtrack_domain and cannot change it.

Is there anything else I can do? I am able to access static YouTrack resources, like

I think this issue was answered for Apache, but I failed to do this with nginx

 location / {
if ($http_referer ~ "^.*/rundeck"){
return 301 /rundeck$request_uri;
if ($http_referer ~ "^.*/youtrack"){
return 301 /youtrack$request_uri;
location /rundeck/ {
proxy_pass http://rundeck_domain:4440/;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
location /youtrack/ {
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
client_max_body_size 10m;
proxy_pass http://youtrack_domain:43088;


If you want to be your new YouTrack address you have to set it as the Base URL.

You cannot simultaneously access YouTrack by (with /youtrack prefix) and http://youtrack_domian:43088/ (without /youtrack prefix) because path from Base URL is used during generation of links. Link cannot include and not include /youtrack/ path prefix at the same time.

For backward compatibility you can, for instance, start YouTrack on different port of youtrack_domian (let it be http://youtrack_domian:43089) and redirect all requests from http://youtrack_domian:43088/ to, which will be reverse proxy for http://youtrack_domian:43089. 



Thank you for your idea for backward compatibility, this is what I will do. 
It's good to know that this is impossible without changing the Base URL.

Thanks again.


Please sign in to leave a comment.