内网搭建 GitLab , 通过 nginx 通到外网遇到问题

2015-11-13 09:20:51 +08:00
 cxq

公司内网有一台服务器已经搭建好了 GitLab

现在想通过一台连通外网的服务器 nginx 做代理 连接到这台内网
在 nginx 上配置如下

GitLab

location /gitlab {
proxy_pass http://192.168.22.188:8888;
proxy_redirect default;
}

外网通过 http://xxx.xxx.xxx.xxx/gitlab
结果首页是可以打开, 但是所有的 css 都没有了。

另外只要登录, 就自动重定向成了
http://xxx.xxx.xxx.xxx/dashboard

导致除了首页 其他所有页面都无法打开?

怎么配置 nginx 才能 css 问题 和 错误重定向问题?

15872 次点击
所在节点    git
26 条回复
qqjt
2015-11-13 14:06:52 +08:00
server
{
listen 80;
server_name xxx.xxx;
location / {
proxy_redirect off;
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_pass http://127.0.0.1:233;
}
access_log /var/log/nginx/gitlab-access.log;
}

我是这么配的, gitlab 地址是 http://127.0.0.1:233
powergx
2015-11-13 14:25:03 +08:00
@jarlyyn 我也 omnibus 装的, external 一改, nginx 反代, 爽 yy 完全没问题
jarlyyn
2015-11-13 14:33:04 +08:00
@powergx

走 https 了么?
cxq
2015-11-13 15:15:40 +08:00
@powergx 求指导 是因为用了 Relative url 吗?
powergx
2015-11-13 20:38:35 +08:00
@jarlyyn external url 写 https ://git.xxx.com 就可以了啊
beling
2015-11-14 11:07:13 +08:00
不想用自带的 nginx , mysql
那你自己编译装啊 可以选择 nginx , Apache , mysql , pgsql

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/235833

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX