環(huán)境現(xiàn)象
為了統(tǒng)一訪問入口奕塑,我們反向代理訪問gitlab-ce
實(shí)現(xiàn)功能
# 修改配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://127.0.0.1:1081/gitlab' #也就添加后綴gitlab
#reconfigure配置文件
gitlab-ctl reconfigure
#重啟服務(wù)
gitlab-ctl restart
設(shè)置nginx反向代理
location /gitlab/ {
client_max_body_size 50m;
proxy_redirect off;
proxy_set_header Host $http_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;
proxy_pass http://127.0.0.1:1081;
index index.html index.htm;
}
驗(yàn)證
修改前
修改后