diff options
| author | 2026-04-26 05:33:46 -0600 | |
|---|---|---|
| committer | 2026-04-26 05:33:46 -0600 | |
| commit | 3679992b44585ced812f5577aec88bd1ada2bdba (patch) | |
| tree | 69a418725bb5ab2351248cc67af0d17a33aeb74a /server.conf | |
init
Diffstat (limited to 'server.conf')
| -rw-r--r-- | server.conf | 55 |
1 files changed, 55 insertions, 0 deletions
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; +} |
