GitLab derrière un reverse proxy
The snippet can be accessed without any authentication.
Authored by
uıןǝnbsɐW ןǝɐʞɔıW
Ce snippet décrit comment positionner GitLab avec un reverse proxy en frontal.
Edit : nginx semble supporté désormais, cf. https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl
Le setup :
- 1 machine en DMZ avec le port tcp/443 ouvert (gitlab.chez-wam.info) qui joue le rôle de RP avec un service Apache2,
- 1 machine dans un réseau privé avec le port tcp/7080 ouvert (gitlab.home.chez-wam.info) qui héberge le service GitLab.
Modification du fichier de configuration pour Omnibus
vim config/gitlab.rb
Vérifier les sections suivantes :
external_url 'https://gitlab.chez-wam.info'
nginx['listen_port'] = 7080
nginx['listen_https'] = false
Relancer le setup d'Omnibus :
gitlab-ctl reconfigure
Modification de la configuration du serveur HTTP pour GitLab
vim data/gitlab-rails/etc/gitlab.yml
Vérifier les sections suivantes :
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: gitlab.home.chez-wam.info
port: 7080
https: false
Relancer le setup d'Omnibus :
gitlab-ctl reconfigure
Redémarrer le service :
gitlab-ctl restart
Une fois l'opération terminée, vérifier la conf. du frontal (RP) Apache2.
a2vhost_gitlab.conf 532 B
<VirtualHost *:443>
ServerName gitlab.chez-wam.info
ProxyPreserveHost On
ProxyRequests Off
SSLProxyEngine on
SSLEngine on
SSLHonorCipherOrder on
<Location />
RequestHeader unset Accept-Encoding
RequestHeader set Host "gitlab.chez-wam.info"
RequestHeader add X-Forwarded-Ssl on
RequestHeader set X-Forwarded-Proto "https"
ProxyPass http://gitlab.home.chez-wam.info:7080/
ProxyPassReverse http://gitlab.home.chez-wam.info:7080/
Order allow,deny
Allow from all
</Location>
</VirtualHost>
Please register or sign in to comment