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 ( and used the external_url setting as well as --hostname in my 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

export GITLAB_HOME=/srv                                                                                                                           

docker run --detach \                                                                                                                             
    --hostname \                                                                                                                 
    --env GITLAB_OMNIBUS_CONFIG="external_url ''" \                                                                
    --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 \                                                                                           

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

You can set http header by nginx config :

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