From b9f1acb2e3eb12c4847e5f8486e156923b3d556e Mon Sep 17 00:00:00 2001 From: Physick <96335032+DegustatorPonos@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:26:28 +0500 Subject: Git selfhost article --- nginx.conf | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 nginx.conf (limited to 'nginx.conf') diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..2b96fa1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,59 @@ +#user http; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + + +# Load all installed modules +include modules.d/*.conf; + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + # gzip on; + + server { + listen 510; + # server_name git.physick.ru; + # server_name 192.168.110.109; + + root /usr/share/cgit; + try_files $uri @cgit; + + location ~* ^/(cgit.(css|png|js|svg)|favicon.ico|robots.txt|cgit_bak.css|(switch|search).svg) { + root /usr/share/webapps/cgit; + expires 30d; + } + + + 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 /srv/git; + fastcgi_param HOME /srv/git; + fastcgi_pass unix:/run/fcgiwrap.sock; + } + + location @cgit { + 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.sock; + } + } +} -- cgit v1.3