home · contact · privacy
GitWeb / git server setup.
[config] / buster / etc_files / website / etc / nginx / sites-available / website.nginx
1 server {
2     listen 443 ssl;
3     server_name REPLACE_fqdn_ECALPER;
4     ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
5     ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
6     root /var/www/html/;
7     index index.html index.htm index.nginx-debian.html;
8
9     # serve /var/repos/* for HTTPS git cloning
10     location ~ /repos/clone(/.*) {
11         include fastcgi_params;
12         fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
13         # fastcgi_param GIT_HTTP_EXPORT_ALL "";
14         fastcgi_param GIT_PROJECT_ROOT /var/repos;
15         fastcgi_param PATH_INFO $1;
16         fastcgi_pass unix:/var/run/fcgiwrap.socket;
17     }
18
19     # gitweb static files
20     location /repos/static/ {
21         alias /usr/share/gitweb/static/;
22     }
23
24     # gitweb; this needs packages fcgiwrap and gitweb
25     location /repos/ {
26         include fastcgi_params;
27         fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi;
28         fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
29         fastcgi_pass unix:/var/run/fcgiwrap.socket;
30     }
31 }