From 966b62d9bd7e483f1e9484a5a99d8c2db475171c Mon Sep 17 00:00:00 2001 From: prospanclaudebot Date: Fri, 10 Jul 2026 22:10:31 +0000 Subject: initial import: pacan-git --- web/nginx.conf | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 web/nginx.conf (limited to 'web/nginx.conf') diff --git a/web/nginx.conf b/web/nginx.conf new file mode 100644 index 0000000..4477a8d --- /dev/null +++ b/web/nginx.conf @@ -0,0 +1,39 @@ +user root; +worker_processes 1; +events { worker_connections 256; } +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + server { + listen 80 default_server; + server_name _; + + # статика cgit (css/иконки) + location /cgit-static/ { + alias /usr/share/cgit/; + access_log off; + } + + # git smart-HTTP: clone/push по /.git/... + location ~ ^/(?[a-zA-Z0-9._/-]+\.git)(?/.*)?$ { + client_max_body_size 0; + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param GIT_HTTP_EXPORT_ALL ""; + fastcgi_param GIT_PROJECT_ROOT /repos; + fastcgi_param PATH_INFO /$gitrepo$gitrest; + fastcgi_pass unix:/run/fcgiwrap.sock; + } + + # cgit — браузинг всего остального + location / { + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param HTTP_HOST $http_host; + fastcgi_pass unix:/run/fcgiwrap.sock; + } + } +} -- cgit v1.2.3