Nginx cannot connect to gitlab socket in centos

Source: Internet
Author: User

Nginx cannot connect to gitlab socket in centos
[root@liantu_61home]#cat/etc/redhat-releaseCentOSrelease6.7(Final)

Error Log:

2016 /01/29 17:36:20[crit]27282 #0:*1connect()tounix:/home/git/gitlab/tmp/sockets/gitlab.socketfailed(13:Permissiondenied)whileconnectingtoupstream,client:192.168.xxx.xxx,server:test61.com,request:"GET/5755/my/notes?target_id=918a696a0e2340c2ee95402fa59187926edaae0c&target_type=commitHTTP/1.1",upstream:"http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/502.html",host:"test61.com",referrer:"http://test61.com/"

Nginx information:

[root@xxx_61home] #psaux|grepnginx root272800.00.017668944?Ss17:350:00nginx:masterprocess /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx .conf www272810.00.0180961652?S17:350:00nginx:workerprocess www272820.00.0184042192?S17:350:00nginx:workerprocess www272830.00.0180961652?S17:350:00nginx:workerprocess www272840.00.0180961636?S17:350:00nginx:workerprocess root275310.00.0103304936pts /0 S+17:390:00 grep nginx

Solution:

Nginx is normal with git. Permission issues are described. However, the server must use www users to run nginx.

Solution: add the nginx running user www to the git Group

Then grant the git user group permissions.

usermod -a-Ggitwww [root@xxx_61home] #idwww uid=501(www)gid=501(www) groups =501(www),503(git) chmod g+rx /home/git/

Information: http://axilleas.me/en/blog/2013/selinux-policy-for-nginx-and-gitlab-unix-socket-in-fedora-19/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.