Youtrack behind nginx on a different domain

Hello,

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
https://my_server.com.com:8083/youtrack/,
browser redirects me to
https://my_server.com:8083/rootGo , 
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
https://my_server:8083/youtrack/_classpath/images/youtrack512.png

I think this issue was answered for Apache, but I failed to do this with nginx 
https://youtrack-support.jetbrains.com/hc/en-us/community/posts/205789809/comments/205933249

 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;
}
}


0
2 comments

See https://www.jetbrains.com/help/youtrack/standalone/Reverse-Proxy-Configuration.html
If you want http://my_server.com:8083/youtrack/ to be your new YouTrack address you have to set it as the Base URL.

You cannot simultaneously access YouTrack by http://my_server.com:8083/youtrack/ (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 http://my_server.com:8083/youtrack/, which will be reverse proxy for http://youtrack_domian:43089. 

1

Mikhail,

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.

0

Please sign in to leave a comment.