I'm trying to run YouTrack instance with following command:

java -Xmx1g -XX:MaxPermSize=250m -Djava.security.egd=/dev/zrandom -Djava.awt.headless=true -Djetbrains.youtrack.baseUrl=http://localhost/yt -Djetbrains.youtrack.disableBrowser=true -jar /opt/youtrack.jar 3579

And i have a nginx proxy (unrelated nginx config parts are omitted):

upstream youtrack {
    server localhost:3579;

server {
    listen       80 default_server;
    listen       [::]:80 default_server;
    server_name  localhost;
    root         /usr/share/nginx/html;

    location / {
            root /var/www/main;
            index index.html;

    location /yt {
            rewrite /yt(.*) /$1 break;
            proxy_pass http://youtrack;
            proxy_redirect off;
            proxy_set_header        X-Real-IP $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header        Host $http_host;

Every time when i enter url http://localhost/yt i'm being redirected to http://localhost/rootGo by YouTrack and then obviously get 404 error. Why is this happening and how can one get YouTrack working on sub url?


Try add the /yt contextPath to youtrack.

java -Xmx1g -XX:MaxPermSize=250m -Djava.security.egd=/dev/zrandom -Djava.awt.headless=true -Djetbrains.youtrack.baseUrl=http://localhost/yt -Djetbrains.youtrack.disableBrowser=true -jar /opt/youtrack.jar 3579/yt

From youtrack documentation: https://confluence.jetbrains.com/display/YTD6/Installing+YouTrack+with+JAR+Distribution

Starting with YouTrack 6.0.12223 you can run YouTrack Standalone with the following command:

java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true <Optional Java Start Parameters> -jar youtrack-<version>.jar [host:]<port>[/contextPath] [config file path]

Implementing support for the 'contextPath' actually allows you now to run YouTrack with the context other then root path previously used by default. Here are a few command examples with various URI configuration for YouTrack server:

java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true -jar youtrack-6.0.12124.jar 8080
java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true -jar youtrack-6.0.12124.jar 8080/youtrack
java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true -jar youtrack-6.0.12124.jar
java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true -jar youtrack-6.0.12124.jar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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