nginx – 如果设置了external_url,Gitlab docker无法正常工作
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx – 如果设置了external_url,Gitlab docker无法正常工作,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4281字,纯文字阅读大概需要7分钟。
内容图文
我一直在努力解决一个我仍然无法解决的问题.非常感谢帮助!
我做了什么:
1)在http://docs.gitlab.com/omnibus/docker/README.html之后,在我的服务器上的Ubuntu 16.04.1 LTS虚拟机上使用docker镜像(8.9.6-ce.0)安装Gitlab-CE
2)在本地设置用户并为同一LAN中的机器推送一些项目>>一切正常
3)向我的防火墙添加新映射以映射gitlab-machine-ip:80> example.org:8138所以我可以用http访问gitlab
我现在能够在http://example.org:8138访问Web界面并使用它
现在的问题:克隆项目的URL显示不正确,因为它们错过了:8138端口(它们从–host设置传递给docker容器得到example.org部分).
如果我手动将自定义端口添加到URL,克隆工作正常
我想解决这个问题所以试试gitlab.rb中的external_url设置将其设置为:
external_url’http://example.org:8138‘
并重新启动(也尝试手动调用gitlab-ctl configure)
状态是我无法在http://example.org:8138获取网页界面在浏览器中获取ERR_CONNECTION_REFUSED
如果我只是注释掉external_url设置,那么一切都恢复正常(除了URL中缺少的端口)
我已经阅读了一堆问题报告,但没有一个帮助解决问题:
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/244>> (我不使用外部NGINX)
在我读到这个:https://gitlab.com/gitlab-org/gitlab-ce/issues/20131后,我也尝试更新到8.11,但它没有帮助
真的不知道这里发生了什么.
输出gitlab-rake gitlab:env:info和gitlab-rake gitlab:检查如下
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:2.3.0
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.11.3
Revision: 6cd4edb
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://example.org:8138
HTTP Clone URL: http://example.org:8138/some-group/some-project.git
SSH Clone URL: git@example.org:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 3.4.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Checking GitLab Shell ...
GitLab Shell version >= 3.4.0 ? ... OK (3.4.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
telemed / banca ... ok
telemed / calcolatrice ... ok
telemed / chat ... ok
telemed / collections ... ok
telemed / interfacce ... ok
telemed / partite ... ok
telemed / polimorfismo ... ok
telemed / ristoranti ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
telemed / banca ... yes
telemed / calcolatrice ... yes
telemed / chat ... yes
telemed / collections ... yes
telemed / interfacce ... yes
telemed / partite ... yes
telemed / polimorfismo ... yes
telemed / ristoranti ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 4
Checking GitLab ... Finished
解决方法:
好的,我能够自己解决问题.
当你更改gitlab.rb中的external_url参数时,有一个副作用(如果你问我,在文档中没有很清楚地解释!)nginx现在将在你输入的端口上运行http://example.org:8138
由于我通过防火墙将外部URL上的端口80映射,因此无法再访问gitlab网站.我建议在文档中明确指出,更改external_url(如果包含端口号)将导致nginx和网站在不同于标准80的端口上运行http!
希望这有助于其他人遇到类似我的问题:slight_smile:
内容总结
以上是互联网集市为您收集整理的nginx – 如果设置了external_url,Gitlab docker无法正常工作全部内容,希望文章能够帮你解决nginx – 如果设置了external_url,Gitlab docker无法正常工作所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。