diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-04-18 20:52:01 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-04-18 20:52:01 +0300 |
commit | 07ef7f7adf770ce453bf65a0ce8a18263a1bf05e (patch) | |
tree | f081e639ad7dddc045d6da8be340da40900f8ad4 | |
parent | 32154fb5c472691e7a1a26d4f2a57dacfcd9360d (diff) | |
download | infrastructure-07ef7f7adf770ce453bf65a0ce8a18263a1bf05e.tar.gz |
feat(cgit): enable HTTP transport
-rw-r--r-- | files/nginx/cgit | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/files/nginx/cgit b/files/nginx/cgit index f31ec08..c4223d0 100644 --- a/files/nginx/cgit +++ b/files/nginx/cgit @@ -4,12 +4,24 @@ server { root /usr/share/cgit ; try_files $uri @cgit ; + # Configure HTTP transport + location ~ /.+/(info/refs|git-upload-pack) { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param PATH_INFO $uri; + fastcgi_param GIT_HTTP_EXPORT_ALL 1; + fastcgi_param GIT_PROJECT_ROOT /home/git; + fastcgi_param HOME /home/git; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + location @cgit { - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; - fastcgi_param PATH_INFO $request_uri; - fastcgi_param QUERY_STRING $query_string; - fastcgi_pass unix:/run/fcgiwrap.socket; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.socket; } # Serve static files |