Project URL refers to `localhost`?

Hi Gitlab Community!

I am running a docker image of gitlab-ce behind an nginx running on the host OS (Debian 10). The installation is working fine but there is one thing I can’t get my head around:

When creating a new group or project, the URL field says http://localhost:10080/gitlab/. While this is technically correct, I thought it should rather show the external URL (http://foo/dnshome/de/gitlab/). Once a project is created, the clone link contains the external URL, as expected, and I can clone repos using these URLs.

I thought I had understood the documentation (https://docs.gitlab.com/omnibus/docker/) and used the external_url setting as well as --hostname in my run.sh script but apparently, I there is still something I didn’t quite grasp.

Any hints or pointers to the appropriate part of the docs are appreciated.

This is my run.sh:

#!/usr/bin/bash                                                                                                                                   
export GITLAB_HOME=/srv                                                                                                                           

docker run --detach \                                                                                                                             
    --hostname foo.dnshome.de \                                                                                                                 
    --env GITLAB_OMNIBUS_CONFIG="external_url 'http://foo.dnshome.de/gitlab/'" \                                                                
    --publish 10080:80 \                                                                                                                          
    --publish 10443:443 \                                                                                                                         
    --name gitlab \                                                                                                                               
    --restart always \                                                                                                                            
    --volume $GITLAB_HOME/gitlab/config:/etc/gitlab \                                                                                             
    --volume $GITLAB_HOME/gitlab/logs:/var/log/gitlab \                                                                                           
    --volume $GITLAB_HOME/gitlab/data:/var/opt/gitlab \                                                                                           
    gitlab/gitlab-ce:latest

My home server is behind a fritzbox router that uses a dynamic DNS service.

My nginx config (sites-available) contains this for redirection:

       location /gitlab/ {
                proxy_pass http://localhost:10080;
                #proxy_pass https://localhost:10443;
        }

Thanks in advance
Phil

You can set http header by nginx config :

location /gitlab/ {
                proxy_pass http://localhost:10080;
                proxy_set_header Host $host;
        }