Run Gitlab behind reverse proxy

Hello:) I have a problem after running Gitlab behind a reverse proxy. The installation of Gitlab was normal and can be accessed with serverip and port but not with domain. If more information is needed, I will provide it.

Gitlab is installed in docker with docker image ‘gitlab/gitlab-ce:latest’

What is the problem?
The connection to Gitlab is only possible via port and IP. When I enter the domain, this takes forever to load and then fails with network timeout.

Docker install command

docker run --detach \
--hostname git.mydomain.xx \
--publish 444:443 --publish 81:80 --publish 320:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest

Nginx config

server {
    if ($host = git.mydomain.xx) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

listen 80;
server_name git.mydomain.xx;
return 301 https://$host$request_uri;

}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name git.mydomain.xx;
ssl on;
        ssl_certificate /etc/letsencrypt/live/git.mydomain.xx/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/git.mydomain.xx/privkey.pem; # managed by Certbot
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
        proxy_pass http://127.0.0.1:81;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        }
}

What i have tried

  • Nginx Log does not contain any error or warning etc
  • Ping on domain does give the correct ip
  • connect with ip is successful
  • tried other configs but same problem
  • server/service restart