1

I installed gitlab-ci using this guide and everything has gone pretty well. I got to the end of the tutorial and when I go to the ip address of the server I only get a Welcome to nginx! screen. I'm using Ubuntu 12.04 server, and I have seen a similar question answered, on stack overflow, but the answer doesn't apply to me (or I don't fully understand it) since I'm not using localhost. I can't use a browser on this server (to the best of my knowledge) since I'm ssh'ing to it.

Here is my /etc/nginx/sites-enabled/gitlab_ci

# GITLAB CI
# Maintainer: @randx
# App Version: 2.0

upstream gitlab_ci {
  server unix:/home/gitlab_ci/gitlab-ci/tmp/sockets/gitlab-ci.socket;
}

server {
  listen 192.168.1.151:80;         # e.g., listen 192.168.1.1:80;
  server_name git-ci 192.168.1.25;     # e.g., server_name source.example.com;
  root /home/gitlab_ci/gitlab-ci/public;

  access_log  /var/log/nginx/gitlab_ci_access.log;
  error_log   /var/log/nginx/gitlab_ci_error.log;

  location / {
    try_files $uri $uri/index.html $uri.html @gitlab_ci;
  }

  location @gitlab_ci {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect     off;

proxy_set_header   X-Forwarded-Proto $scheme;
proxy_set_header   Host              $http_host;
proxy_set_header   X-Real-IP         $remote_addr;

proxy_pass http://gitlab_ci;
  }

  # adjust this to match the largest build log your runners might submit,
  # set to 0 to disable limit
  client_max_body_size 10m;
}

I think my problem is in the server_name field, but my ip address is all I have for the server. I don't have an actual name for the server set up via DNS yet, so I'm not sure what I should put for the server_name and source.example.com for the server_name field. I've tried a few combinations, but nothing has worked. Thanks for any help.

trueCamelType
  • 1,086
  • 5
  • 20
  • 42

2 Answers2

2

If you are not planning to host additional domains on the same server, you can make this gitlab instance the default virtualhost with these instructions:

  1. Disable the default server by removing /etc/nginx/sites-enabled/default

  2. Replace listen and server_name with the following lines:

listen 80 default_server;

server_name _;

With these settings you should be able to access gitlab.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • Just to add, the above for me resulted in a bad gateway error (Running gitlab_ci on CentOS not Ubuntu), and the fix for me was to change the proxy_pass line to point to 127.0.0.1:8080 which is the port that Unicorn is listening on. –  Jul 07 '14 at 18:35
0

This worked for me; I stopped the nginx service systemctl stop nginx

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
adam
  • 1