I am following this instruction to install gitlab: https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md

All is well until #7. nginx. I have problem with this specific instruction

# to the IP address and fully-qualified domain name
# of your host serving GitLab
sudo vim /etc/nginx/sites-available/gitlab

Can I use and localhost for YOUR_SERVER_IP and YOUR_SERVER_FQDN respectively? I really don't want to use any .coms, this gitlab will be used internally.

When I visited localhost, it shows 502 Bad Gateway.

My error_log file content

2013/03/24 09:18:21 [crit] 12152#0: *1 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client:, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/", host: "localhost"

Your help is highly appreciated. Thank you.

  • Can you please show the output from your nginx logs related to the 502 Bad Gateway error? You're going to need further details in this question to narrow down where the issue is arising. Mar 24, 2013 at 23:08
  • Hi @MarkStanislav, I've update my question to include the error log.
    – Iyas
    Mar 25, 2013 at 0:09

1 Answer 1


Verify that /home/git/gitlab/tmp/sockets/gitlab.socket actually exists and have permissions/ownership in-line with the setup instructions. Also, try running these two commands inside of the /home/git/gitlab directory:

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

All items should be green. If not, you'll have to troubleshoot more specifically from there.

Here's a Github issue related to what you are seeing. Hopefully the above steps fix it or at least get you further!

Your database is not setup properly OR your credentials for accessing it are wrong. Please make sure you followed https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/databases.md and did one of the following as instructed for your DB platform.


sudo -u git cp config/database.yml.mysql config/database.yml


sudo -u git cp config/database.yml.postgresql config/database.yml

  • Oh no, I missed to inform you that after I ran those two commands, I don't get green items...
    – Iyas
    Mar 25, 2013 at 1:02
  • got this error: rake aborted! Access denied for user 'root'@'localhost' (using password: YES)
    – Iyas
    Mar 25, 2013 at 1:05
  • Thanks Mark! Now I can see the green and the red items...
    – Iyas
    Mar 25, 2013 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.