I would like to redirect the old base url of git repositories. I use the following code:
location ~ ^/scm/git/(.*) {
return 301 /scm/repo/git/$1;
}
In the browser, the redirection works fine, but when I try to clone the repository, I get the following error message:
fatal: unable to update url base from redirection:
asked for: https://example.com/scm/git/xxxx/info/refs?service=git-upload-pack
redirect: https://example.com/scm/repo/git/xxxx/info/refs
Can you please help me, what have I forgotten? Thank you very much!