大网数据广告活动
服务器运维问答

Installed gitlab-ci but only nginx welcome page shows

· 52CE 我爱测

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 …

问题原文

原帖链接 · trueCamelType · CC BY-SA 3.0

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.

已采纳解答

原帖链接 · Tero Kilkanen · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-05-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。