我已經成功地在數字海洋液滴上安裝了gitlab-omnibus。我也在同一臺服務器上安裝了Jenkins。所有的應用程序都可以通過子域和Nginx的SSL反向代理設置。 Nginx的部分似乎工作,因爲我能夠用自己的子域名來訪問詹金斯和GitLab,例如:克隆鏈接與GitLab-Omnibus安裝不匹配external_url
https://git.example.com - > 127.0.0.1:8080 https://ci.example.com - > 127.0.0.1:8081
唯一我仍然無法工作的是gitlab.rb文件中的external_url指令。無論我放在那裏,每個回購網址仍然是http://example.com/myuser/myrepo.git。
我FQDN是example.com而不是git.example.com因爲我也有同樣的機器上,但在不同的子域名等服務器。有沒有辦法強制gitlab使用https://git.example.com主機名而不是FQDN?
這裏是我的/etc/gitlab/gitlab.rb的副本:
external_url = 'git.example.com'
unicorn['worker_processes'] = 3
unicorn['worker_timeout'] = 100
postgresql['shared_buffers'] = '100MB'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "localhost"
gitlab_rails['smtp_port'] = 456
#gitlab_rails['smtp_user_name'] = "smtp user"
#gitlab_rails['smtp_password'] = "smtp password"
gitlab_rails['smtp_domain'] = "example.com"
#gitlab_rails['smtp_authentication'] = "login"
#gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]'
這是我的nginx的配置:
upstream gitlab {
server unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;
}
server {
listen 80;
server_name git.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443;
server_name git.example.com;
ssl_certificate /etc/nginx/star.example.com.crt;
ssl_certificate_key /etc/nginx/star.example.com.key;
ssl on;
ssl_session_timeout 5m;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/gitlab.access.log;
location/{
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 90;
proxy_redirect http://127.0.0.1:8080 https://git.example.com;
}
}
我沒有改變gitlab後運行sudo gitlab-ctl reconfigure
。 rb文件。
在此先感謝您的幫助!
爲什麼給我的問題-1沒有留下評論? – 2014-11-26 14:48:09
我不是downvoter,但你做了這個改變後是否運行了這個命令? 'sudo gitlab-ctl reconfigure' – 2014-11-27 10:28:57
是的,我做到了。每次我嘗試了其他配置。 – 2014-11-27 15:46:32