Heya folks, I hope you can help me out in my situation, as I must be missing something obvious that’s not part of the documentation. I’ve followed a few different documentations (linked below) and forum entries, but I keep getting a 502 Bad Gateway whenever I try to set the ‘external_url’ to fix gitlab linking to an internal (inaccessible) IP for tasks.
My Setup
CloudFlare domain with Origin SSL Certificate
Unraid Server with an NGINX docker and GitLab-CE docker.
GitLab-CE is set to listen to ports 7380 (HTTP) and 7343 (HTTPS)
NGINX forwards subdomain git.mydomain.org
→ 192.168.178.20 : 7380
(Unraid IP and docker port)
This setup, in itself, works when external_url
is not set
My Issue
Password Recovery E-Mails have the URL http://unraid:9080
Tasks linked under in Issues have the URL unraid:9080/projectname/-/work_items/25
This means that half the time when I click something in gitlab, it will try to go to the internal (!) address within the docker rather than the actual domain name I’m accessing the page from.
When I set external_url
to any of the following (to my understanding correct) values, it breaks with a 502 Bad Gateway error. Some say to include the port, some do it without. I tried them all and they all don’t work.
http://git.mydomain.org
http://git.mydomain.org:7380
https://git.mydomain.org
https://git.mydomain.org:7343
Configuration
NGINX
SYSTEM
GitLab SSL folder permissions
gitlab.rb
external_url 'https://git.mydomain.org'
# PORTS & ROUTING
nginx['ssl_certificate'] = "/etc/gitlab/ssl/mydomain.org.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/mydomain.org.key"
# nginx['redirect_http_to_https'] = true #tried w+w/o
# nginx['redirect_http_to_https_port'] = 7343 # tried w+w/o
nginx['listen_addresses'] = ['*', '[::]']
nginx['listen_port'] = 7380
nginx['listen_https'] = false
nginx['referrer_policy'] = 'same-origin'
web_server['external_users'] = ['www-data']
puma['port'] = 7380
# SERVICES
nginx['enable'] = false #tried w+w/o
letsencrypt['enable'] = false
# puma['enable'] = false #tried w+w/o
gitlab_kas['enable'] = false
prometheus['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
# RAILS
gitlab_rails['smtp_enable'] = true
gitlab_rails['incoming_email_enabled'] = false
gitlab_rails['terraform_state_enabled'] = false
Things I’ve Tried
Various different attempts described on the Forum as well as the Documentations, all of which seem to have some variation on what to do.
Setting only the ‘external_url’, disabling nginx, disabling puma, setting gitlab_rails[‘internal_api_url’], setting web_server[‘external_users’] = [‘www-data’], nginx[‘redirect_http_to_https’], specifying the ports … all in various combinations.
Whatever I tried, the result was always the same: 502 bad gateway
Docu: Nginx
Docu: Manual SSL for Nginx
Forum: File permissions and setting cert path
Forum: Cert chmod check and [‘www-data’] for my system
Forum: Recommended changing Puma Port