Securing youtrack with SSL at mydomain/youtrack

So I found the online documentation suggesting to either modify the internal webserver, or using mod_proxy with Apache, and I have the mod_proxy working on a unique port. So I can go to https://mydomain.com:1234 and have it proxied to the youtrack server. That works fine. But what I want to do is to go to https://mydomain.com/youtrack. When I implement the same functionality on port 443 (no other servers running on this port yet), like this:

ProxyRequests Off
ProxyPass /~socket.io/1/websocket ws://127.0.0.1:8765/~socket.io/1/websocket

            Alias /youtrack /opt/youtrack
            <Location /youtrack>
                    SSLRequireSSL
                    Header edit Location ^http: https:

                    ProxyPass http://127.0.0.1:8765/
                    ProxyPassReverse http://127.0.0.1:8765/

                    RequestHeader set X-Forwarded-Proto "https"
            </Location>

It doesn't work. I end up at https://mydomain.com/rootGo

The proxy seems to be failing to modify the url correctly. I have also tried
ProxyPass /youtrack/ http://127.0.0.1:8765/
ProxyPassReverse /youtrack/ http://127.0.0.1:8765/

and

  ProxyPass /youtrack/ http://127.0.0.1:8765/youtrack/
  ProxyPassReverse /youtrack/ http://127.0.0.1:8765/youtrack/

The first one does the same as the original. I end up at rootGo, the second tries to go to the /youtrack/ path on the youtrack server, which gives me a page not found error. It really should be possible to set this up. I need multiple ssl sites on this machine, and would really like to be able to go to mydomain/path for each of them.

Can anyone shed some light on this?

I'm running Ubuntu 14.04, Apache 2.4.7, and Youtrack 6.5

1 comment
Comment actions Permalink

Of course I have been looking at this for 24 hours or more now and as soon as I post the question I find the answer.

It seems bizarre to me that you can't proxy from /youtrack to /domain:###/ successfully. I just knew there had to be a way.

In the end though, I had seen where someone modified the web root of youtrack, though it took me time to find it. In linux, I modified the base-url field in youtrack-home/conf/internal/bundle.properties. I changed it from http://mydomain:port/ to http://mydomain:port/youtrack

Then the proxy pass worked correctly.

0

Please sign in to leave a comment.