pages_nginx['redirect_http_to_https'] should inherit from nginx['redirect_http_to_https']
Discovered while debugging gitlab-pages#213 (closed)
If a user is running Pages in "shared IP" mode, the omnibus NGINX server is responsible for detecting whether a request is ultimately destined for gitlab-rails or gitlab-pages. It does this by inspecting the Host
header, or using SNI, and this generally works fine.
However, if the user's gitlab.rb file looks like:
nginx['redirect_http_to_https'] = true
then this doesn't work for HTTP Pages requests. Instead, those HTTP Pages requests end up being redirected to gitlab-rails, where they fail with a 404 error.
The working configuration is:
nginx['redirect_http_to_https'] = true
pages_nginx['redirect_http_to_https'] = true
I think it makes sense to default the pages_nginx
setting from the nginx
setting, if set, so this situation can't arise as easily
Edited by Nick Thomas