From 3679992b44585ced812f5577aec88bd1ada2bdba Mon Sep 17 00:00:00 2001 From: steering7253 Date: Sun, 26 Apr 2026 05:33:46 -0600 Subject: init --- server.conf | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 server.conf (limited to 'server.conf') diff --git a/server.conf b/server.conf new file mode 100644 index 0000000..0b5029e --- /dev/null +++ b/server.conf @@ -0,0 +1,55 @@ +http2 on; +access_log /var/log/nginx/access.log main; + +location /.well-known/ { + root /var/www/localhost/htdocs; +} + +location ~ "^/([^/]+)/(.+/objects/[0-9a-f]{2}/[0-9a-f]{38})$" { + alias /home/$1/$2; + add_header Handler "git object" always; +} +location ~ "^/[^/]+/.*\.git/(HEAD|info/refs|objects/(info/[^/]+|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(pack|idx))|git-(upload|receive)-pack)$" { + fastcgi_pass 127.0.0.1:1733; + include fastcgi-git-http-backend.conf; + add_header Handler "git-http-backend" always; +} +location ~ /.+/ { + fastcgi_pass 127.0.0.1:1733; + include fastcgi-cgit.conf; + add_header Handler "cgit" always; +} +location = / { + try_files /dev/null @index; +} +location = /index.html { + try_files /dev/null @index; +} +location @index { + root /home/cgitspace/www/public; + fastcgi_index index.html; + try_files $uri $uri/ =404; + fastcgi_pass unix:/run/php-fpm/cgit.sock; + include fastcgi_params; +} +location / { + if (-d /home/$uri) { + return 301 $uri/; + } + root /home/cgitspace/www/public; + try_files $uri $uri/ =404; +} +location ^~ /cgit/ { + alias /usr/share/webapps/cgit/9999-r9999/htdocs/; + add_header Handler "cgit-static" always; +} + +location = /basic_status { + stub_status; + access_log off; + allow 127.0.0.1; + allow ::1; + allow 10.0.0.0/24; + allow 172.20.210.4; + deny all; +} -- cgit v1.3.1-10-gc9f91