healthcheck script is failing behind reverse-proxy resulting in loopy container reboot
latest version of gitlab 8.17 - introduced healthcheck for the container.
Under specific condition it generates wrong values in /opt/gitlab/etc/gitlab-healthcheck-rc
with invalid combination of port schema host variable values. This particular issue arises when using integrated nginx , default nginx['enable'] = true
and nginx['listen_https'] = false
and reverse proxy with SSL termination before that. in which case these settings :
gitlab.rb
external_url 'https://git.domain1.com'
nginx['enable'] = true
nginx['listen_https'] = false # also tried = nil
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-healthcheck.rb
server_host = node['gitlab']['nginx']['enable'] ? 'localhost' : Gitlab['gitlab_rails']['gitlab_host']
server_schema = node['gitlab']['gitlab-rails']['gitlab_https'] ? 'https' : 'http'
results in this: /opt/gitlab/etc/gitlab-healthcheck-rc
host='https://localhost'
port='80'
path='/help'
If i understand it correctly - then above scenario is inline with how things are supposed to be configured based on this: https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server
it should have probably configured host variable with the value from the external_url and not localhost, so the condition seems odd here:
server_host = node['gitlab']['nginx']['enable'] ? 'localhost' : Gitlab['gitlab_rails']['gitlab_host']
I'm guessing that healthcheck script should be testing real URL, not localhost, so this should probably be something along the lines of:
server_host = node['gitlab']['nginx']['enable'] ? Gitlab['external_url'] : Gitlab['gitlab_rails']['gitlab_host']