src.nth.io/

summaryrefslogtreecommitdiff
path: root/git/web/templates/cgit.nginx.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'git/web/templates/cgit.nginx.conf.j2')
-rw-r--r--git/web/templates/cgit.nginx.conf.j25
1 files changed, 5 insertions, 0 deletions
diff --git a/git/web/templates/cgit.nginx.conf.j2 b/git/web/templates/cgit.nginx.conf.j2
index 0ddbe38..324dd0c 100644
--- a/git/web/templates/cgit.nginx.conf.j2
+++ b/git/web/templates/cgit.nginx.conf.j2
@@ -25,6 +25,11 @@ server {
root /usr/share/cgit;
+ # Redirect old Mercurial-style paths to cgit equivalents
+ rewrite ^/([^/]+)/file/tip/(.*)$ /$1/tree/$2 permanent;
+ rewrite ^/([^/]+)/file/tip$ /$1/tree permanent;
+ rewrite ^/([^/]+)/file$ /$1/tree permanent;
+
try_files $uri @cgit;
location @cgit {