我正在使用git git git-http-backend脚本在nginx后面的git服务器上工作。
目前,我有一台乘客服务器,该服务器正在端口2222上使用Rails应用程序。但是,在/git/文件夹后面,我想提供git存储库。问题是,nginx似乎没有启动脚本。无论是使用插座文件还是其他Localhost帖子,我都会获得502错误。这显示在Nginx错误日志中:
2017/06/07 18:43:03 [error] 2147#0: *3 no live upstreams while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /git/me/repo HTTP/1.1", upstream: "fastcgi://localhost", host: "localhost:2222"
似乎Nginx没有启动处理Git文件的过程。
这是我的位置NGINX设置的一部分:
location ~ /git(/.*) {
include fastcgi.conf;
include fastcgi_params;
#fastcgi_pass 127.0.0.1:8888;
fastcgi_param SCRIPT_FILENAME /Library/Developer/CommandLineTools/usr/libexec/git-core/git-http-backend;
# export all repositories under GIT_PROJECT_ROOT
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /Users/userx/Documents/Projecten/repositories;
fastcgi_param PATH_INFO $1;
fastcgi_keep_conn on;
fastcgi_connect_timeout 20s;
fastcgi_send_timeout 60s;
fastcgi_read_timeout 60s;
#fastcgi_pass 127.0.0.1:9001;
fastcgi_param REMOTE_USER $remote_user;
#fastcgi_pass unix:/var/run/fcgi/fcgiwrap.socket;
fastcgi_pass localhost:9001;
}
我不能独自弄清楚,有人可以分享他们对此的想法吗?
检查nginx是否可以将文件写入包含git repo的文件夹。nginx作为用户www-data:www-data
运行,因此这些文件可能具有以下文件的权限:
permission owner group file
drwxr-xr-x www-data www-data ./repoA
dr-xrwxr-x some-owner www-data ./repoB
drwxr-xr-x some-owner www-data ./repoError502