Nginx – If external_url is set, GitLab Docker does not work properly.

I have been trying to solve a problem that I still can’t solve. Thank you very much for your help!
What I did:
1) After http://docs.gitlab.com/omnibus/docker/README.html, use docker image on Ubuntu 16.04.1 LTS virtual machine on my server (8.9.6-ce.0) Install Gitlab-CE
2) Set up users locally and push some items for machines in the same LAN >> Everything is ok
3) Add a new mapping to my firewall to map gitlab-machine-ip: 80> example.org: 8138 so I can use http to access gitlab

I can now access the web interface at http://example.org:8138 and use it< br>The problem now: The URL of the cloned project is not displayed correctly because they are missing: port 8138 (they get the example.org part from the –host setting passed to the docker container).
If I manually add the custom port to URL, cloning works fine

I want to solve this problem, so try the external_url setting in gitlab.rb and set it to:
external_url’http://example.org:8138′
And restart (also try to manually call gitlab-ctl configure)

The status is that I cannot get the web interface at http://example.org:8138 and get ERR_CONNECTION_REFUSED in the browser.
If I just comment Drop the external_url setting, then everything is back to normal (except for the missing port in the URL)

I have read a bunch of problem reports, but none of them helped solve the problem:
https://gitlab.com /gitlab-org/omnibus-gitlab/issues/244>> (I don’t use external NGINX)
After I read this: https://gitlab.com/gitlab-org/gitlab-ce/issues/20131 , I also tried to update to 8.11, but it did not help

I really don’t know what happened here.
Output gitlab-rake gitlab:env:info and gitlab-rake gitlab:check as follows

p>

System information
System:
Curren t 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: [email protected]:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
< br />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< br />Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK< br />Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...< br />
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

Checki ng LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...< br />
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 versi on >= 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

Okay, I can solve the problem by myself.
When you change the external_url parameter in gitlab.rb, there is a side effect (if you ask me, it is not very clear in the document explain! ) nginx will now run http://example.org on the port you entered: 8138

Because I mapped port 80 on the external URL through the firewall, I can no longer access the gitlab website. I suggest to make it clear in the documentation that changing the external_url (if the port number is included) will cause nginx and the website to run http on a port different from the standard 80!

I hope this helps others encounter problems similar to mine: slight_smile:

I have been trying to solve a problem that I still can’t solve .Thanks a lot for the help!
What I did:
1) After http://docs.gitlab.com/omnibus/docker/README.html, use docker image on Ubuntu 16.04.1 LTS virtual machine on my server (8.9.6-ce.0) Install Gitlab-CE
2) Set up users locally and push some items for machines in the same LAN >> Everything is ok
3) Add a new mapping to my firewall to map gitlab-machine-ip: 80> example.org: 8138 so I can use http to access gitlab

I can now access the web interface at http://example.org:8138 and use it< br>The problem now: The URL of the cloned project is not displayed correctly because they are missing: port 8138 (they get the example.org part from the –host setting passed to the docker container).
If I manually add the custom port to URL, cloning works fine

I want to solve this problem, so try the external_url setting in gitlab.rb and set it to:
external_url’http://example.org:8138′
And restart (also try to manually call gitlab-ctl configure)

The status is that I cannot get the web interface at http://example.org:8138 and get ERR_CONNECTION_REFUSED in the browser.
If I just comment Drop the external_url setting, then everything is back to normal (except for the missing port in the URL)

I have read a bunch of problem reports, but none of them helped solve the problem:
https://gitlab.com /gitlab-org/omnibus-gitlab/issues/244>> (I don’t use external NGINX)
After I read this: https://gitlab.com/gitlab-org/gitlab-ce/issues/20131 , I also tried to update to 8.11, but it did not help

I really don’t know what happened here.
Output gitlab-rake gitlab:env:info and gitlab-rake gitlab:check as follows

p>

System information
System:
Current User: gi t
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:2.3.0
Rake Version: 10.5.0< br />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: [email protected]: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
R epo 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< br />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

Okay, I can solve the problem by myself.
When you change the external_url parameter in gitlab.rb, there is a side effect (if you ask me, it is not clearly explained in the documentation! ) nginx will now run http://example.org on the port you entered: 8138

Because I mapped port 80 on the external URL through the firewall, I can no longer access the gitlab website. I suggest to make it clear in the documentation that changing the external_url (if the port number is included) will cause nginx and the website to run http on a port different from the standard 80!

I hope this helps others encounter problems similar to mine: slight_smile:

Leave a Comment

Your email address will not be published.