server {
listen 8800 default_server;
root /home/git;
index index.html index.htm index.nginx-debian.html;
server_name _;
location ~ /git(/.*) {
#try_files $uri $uri/ =404;
#autoindex on;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /home/git ;
fastcgi_param PATH_INFO $1;
include fastcgi_params;
}
}
原文:https://blog.51cto.com/ting2junshui/2390550