diff options
Diffstat (limited to 'public/fs/etc/nginx')
-rw-r--r-- | public/fs/etc/nginx/vhosts.d/git.midipix.org.conf | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/public/fs/etc/nginx/vhosts.d/git.midipix.org.conf b/public/fs/etc/nginx/vhosts.d/git.midipix.org.conf index 4b014be..2feaf0c 100644 --- a/public/fs/etc/nginx/vhosts.d/git.midipix.org.conf +++ b/public/fs/etc/nginx/vhosts.d/git.midipix.org.conf @@ -9,14 +9,37 @@ server { server_name git.midipix.org; root /srv/www/htdocs; + # legacy (bookmarked) /cgit.git addresses location /cgit.cgi { rewrite ^/cgit.cgi(/.*)$ $1 last; } + # git-http-backend: initial clone GET request + location ~ ^(/namespace)?/(.+?)/info(/.*)?$ { + try_files $uri @git_http_backend; + } + + # git-http-backend: clone POST request + location ~ ^(/namespace)?/(.+?)/git-upload-pack { + try_files $uri @git_http_backend; + } + + # otherwise, cgit location / { try_files $uri @cgit; } + location @git_http_backend { + include uwsgi_params; + uwsgi_modifier1 9; + uwsgi_pass unix:/run/uwsgi/git.socket; + + uwsgi_param HTTP_HOST $server_name; + uwsgi_param GIT_PROJECT_ROOT /srv/git; + uwsgi_param PATH_INFO $uri; + uwsgi_param GIT_HTTP_EXPORT_ALL ""; + } + location @cgit { include uwsgi_params; uwsgi_modifier1 9; |