Force HTTPS (requires valid certificates) checkbox doesn't work

Summary

Force HTTPS (requires valid certificates) in settings doesn't work. If the checkbox is unchecked it's still redirecting to HTTPS.

Steps to reproduce

  1. Setup a project
  2. Add a job which creates content for GitLab pages
  3. Go to project settings/pages and turn off the checkbox Force HTTPS (requires valid certificates)
  4. Click on Save
  5. Set pages_nginx['redirect_http_to_https'] = false in the nginx config
  6. Reload nginx

What is the current bug behavior?

If the checkbox is unchecked it's still redirecting to HTTPS.

What is the expected correct behavior?

If the checkbox is unchecked it should not redirect to HTTPS, just keep HTTP.

Output of checks

$ curl -I http://name.gitlab-instance.com/project

HTTP/1.1 307 Temporary Redirect

Results of GitLab environment info

GitLab 11.5.3 (aa11737)
GitLab Shell 8.4.1
GitLab Workhorse v7.1.3
GitLab API v4
GitLab Pages 1.3.1
Ruby 2.4.5p335
Rails 4.2.10
postgresql
Edited by Jason Yavorsky