Gitlab SSL with reverse proxy

Hi,

I fail to configure Gitlab with SSL, because I use a reverse proxy which is not on the same server. The SSL files are located at the reverse proxy server.
When I go to my domain https://git.example.com, I get an 502 Bad Gateway nginx error.
Here is my configuration of nginx:

server {
       listen 80;
       listen [::]:80;
        server_name git.example.com;
        return 301 https://$host$request_uri;
}
server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name git.example.com;
        ssl on;
        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        location / {
                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;
                proxy_buffering off;
                proxy_pass http://192.168.0.110/;
        }
}

And my EXTERNAL_URL in Gitlab is “https://git.example.com”.

*When I change the EXTERNAL_URL to HTTP, then everything works fine. HTTP is redirected to HTTPS. But when I create a new project, the project URL is still HTTP.

Do I have to make any further settings?