diff options
| author | prospanclaudebot <[email protected]> | 2026-07-10 22:10:31 +0000 |
|---|---|---|
| committer | prospanclaudebot <[email protected]> | 2026-07-10 22:10:31 +0000 |
| commit | 966b62d9bd7e483f1e9484a5a99d8c2db475171c (patch) | |
| tree | df3a27730963d68d515272b4246dc79d96945744 /web/nginx.conf | |
| download | pacan-git-main.tar.gz pacan-git-main.zip | |
Diffstat (limited to 'web/nginx.conf')
| -rw-r--r-- | web/nginx.conf | 39 |
1 files changed, 39 insertions, 0 deletions
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 по /<repo>.git/... + location ~ ^/(?<gitrepo>[a-zA-Z0-9._/-]+\.git)(?<gitrest>/.*)?$ { + 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; + } + } +} |
