[Docker] Reverse proxy configuration does not work
Hello,
I am trying to set up a Gitlab instance using the official Omnibus Docker image and an nginx reverse proxy running on a separate container (since I have a bunch of other web services on different virtual hosts).
As per the documentation, I set nginx['listen_port'] = 80
and nginx['listen_https'] = nil
while having external_url 'https://gitlab.domain.com'
in gitlab.rb
. The combination of having an HTTPS external URL and disabling HTTPS in Gitlab should point to the configuration process that I want to run this instance behind a reverse proxy.
However, I get the following error in the logs:
==> /var/log/gitlab/nginx/error.log <==
2019/10/01 14:02:26 [emerg] 2610#0: no "ssl_certificate" is defined for the "listen ... ssl" directive in /var/opt/gitlab/nginx/conf/gitlab-http.conf:34
And I get a 502 error when trying to access my instance at https://gitlab.domain.com.
In /var/opt/gitlab/nginx/conf/gitlab-http.conf
there's a bunch of configuration options that shouldn't be there for an HTTP-only host, such as redirecting all HTTP traffic to the HTTPS host, listening for SSL traffic, setting up the SSL certificate and keys, HSTS, etc.
So I'm guessing that the Gitlab configurator is looking only at the external_url
option and configuring my instance as an HTTPS host, ignoring the other options.
Is anyone else having this issue?
Thank you for your time.