Custom URL with NGINX rewriting

Issue #599 duplicate
Former user created an issue

Hello, I just discovered your awesome project and want to use it as repository manager for all of my future projects but I ran into a little problem:

Because I wanted to have short Repository-URLs I used NGINX to proxy internally to localhost:8080 which worked without problems. But for the sake of as-short-as-possible URLs I wanted to get rid of the /scm/ in the URLs. So I rewrote the URLs internally to use as repo url and for the management interface.

location / {
                rewrite /(.*) /scm/$1 break;
                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;
                proxy_set_header X-NginX-Proxy true;
                proxy_pass http://localhost:8080/;
                proxy_redirect off;

No problem so far for the repo checkout, but the Management Interface has the problem it sets the cookie path for the session cookies to /scm although I set the "Base URL" in the configuration to Response Header-> Set-Cookie:JSESSIONID=1jcyivsxade101t3n32zu6racy;Path=/scm

I also read this article from the FAQ but in the Example you just keep the /scm suffix. If I try to use NGINX's proxy_cookie_path replacement method I just get internal server errors at the login.

Is it possible to remove the /scm/ from the urls ?

Comments (2)

  1. Log in to comment