- Nginx conf is above
- Then, supposing the repository owner is the user git
systemctl enable fcgiwrap@git
systemctl start fcgiwrap@git
systemctl status fcgiwrap@git
server { | |
listen 80; | |
listen 443 ssl; | |
server_name git.example.com; | |
access_log /var/www/virtual/git.example.com/logs/access.log; | |
error_log /var/www/virtual/git.example.com/logs/error.log; | |
ssl_certificate /etc/letsencrypt/live/git.example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/git.example.com/privkey.pem; | |
disable_symlinks off; | |
include letsencrypt.conf; | |
root /var/www/virtual/git.example.com/html; | |
location / { | |
autoindex on; | |
try_files $uri $uri/ =404; | |
} | |
location ~ \.git/ { | |
include fastcgi_params; | |
client_max_body_size 0; | |
limit_except GET HEAD OPTIONS { | |
auth_basic "Git Login"; | |
auth_basic_user_file "/var/www/virtual/git.example.com/conf/htpasswd"; | |
} | |
fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend; | |
fastcgi_param GIT_HTTP_EXPORT_ALL ""; | |
fastcgi_param GIT_PROJECT_ROOT $document_root; | |
fastcgi_param PATH_INFO $document_uri; | |
fastcgi_param REMOTE_USER $remote_user; | |
fastcgi_read_timeout 300; | |
fastcgi_pass unix:/run/fcgiwrap/fcgiwrap-git.sock; | |
} | |
} |