How to correctly route a Gitlab installation in a subdirectory through an SSL reverse proxy?

The following was missing in site-config:

proxy_set_header X-Forwarded-Ssl on;