HTTPS - LoadBalancer requesting HTTP - Wrong NginX Config

Hi,

we operate a HTTPS loadbalancer, who forwards requests to HTTP. After changing the following 3 lines in the file /etc/gitlab/gitlab.rb the page loaded, but login did not work, I received redirects to http again.

external_url "https://..."
nginx['listen_https'] = false
nginx['listen_port'] = 80

In the NginX Configuration (/var/opt/gitlab/nginx/conf/gitlab-http.conf), I can still see:

proxy_set_header    X-Forwarded-Proto   $scheme

This does not work, as the forward requests are sent by http.

Hence, I edited /opt/gitlab/embedded/cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb and changed that to:

proxy_set_header    X-Forwarded-Proto   https

Then, the login works again. Before, I received the error:

Started POST "/users/auth/ldapmain/callback" for 1.2.3.4 at 2015-07-24 08:52:51 +0200

Processing by OmniauthCallbacksController#ldapmain as HTML

Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "username"=>"exampleuser", "password"=>"[FILTERED]"}

Can't verify CSRF token authenticity