Project URL defaults to host name, not external_url

I just installed Gitlab and after several days of chasing configuration issues due to my network topology, got it working.

But when I try to create a new project, I get the original Project URL which is local instead of the external URL.

E.g.: https://mediaserver:8000/gitlab/

My gitlab.rb file contains: external_url ‘https://vmoregon.com/gitlab

I’ve searched through the settings, the database and the filesystem and I can’t find where this is coming from.

It’s global. I’ve created several test users and it’s the same for each of them.

I’ve reconfigured and restarted and can’t change it.

The site itself works fine (as much as I’ve been able to test).

After 2 years, I finally answered my own question.

I’m running gitlab behind a proxy (IIS) and I needed to enable the server variables, both on IIS and in gitlab.rb.

I added the following to IIS:
HTTP_X_FORWARDED_PROTO
HTTP_X_FORWARDED_PORT
HTTP_X_FORWARDED_HOST
HTTP_X_FORWARDED_FOR

and uncommented the following in gitlab.rb:
nginx[‘proxy_set_headers’] = {
“Host” => “$http_host_with_default”,
“X-Real-IP” => “$remote_addr”,
“X-Forwarded-For” => “$proxy_add_x_forwarded_for”,
“X-Forwarded-Proto” => “https”,
“X-Forwarded-Ssl” => “on”,
“Upgrade” => “$http_upgrade”,
“Connection” => “$connection_upgrade”
}

1 Like