Gitlab: Login leva a um loop de redirecionamento infinito

Gitlab: Login leva a um loop de redirecionamento infinito

desde ontem estou tentando instalar o Gitlab no meu servidor doméstico, mas até agora não tive sorte em fazê-lo funcionar :(

Instalei-o no Ubuntu 14.04 usando os pacotes disponíveis no site do Gitlab em:https://about.gitlab.com/downloads/#ubuntu1404

Então configurei para usar o domínio externohttps://gitlab.example.com(alterado por motivos de segurança) e quero fazer proxy via Apache usando um proxy reverso com SSL.

Até agora consigo ver a página de login e navegar, mas quando tento fazer login usando o nome de usuário e a senha padrão acabo em um loop infinito de redirecionamentos e não consigo encontrar o motivo. Tentei todas as soluções que encontrei até agora, mas nenhuma delas funcionou para mim.

Fiz algumas alterações em /etc/gitlab/gitlab.rb:

external_url 'https://gitlab.example.com'
unicorn['port'] = 8890 # needed, since the port 8080 was already in use
nginx['listen_addresses'] = ['*']
nginx['listen_port'] = 8888
nginx['listen_https'] = false

Meu vHost Apache 2.4 está configurado assim:

<VirtualHost *:80>
  ServerName gitlab.example.com

  ErrorLog /var/log/apache2/gitlab.example.com-error.log

  Redirect / https://gitlab.example.com/
</VirtualHost>

<VirtualHost *:443>
  ServerName gitlab.example.com

  ErrorLog /var/log/apache2/gitlab.example.com-error.log

  RequestHeader set Host "gitlab.example.com"
  RequestHeader add X-Forwarded-Ssl on
  RequestHeader set X-Forwarded-For %{REMOTE_IP}e
  RequestHeader set X-Forwarded-Proto "https"

  ProxyPreserveHost On
  ProxyPass / http://localhost:8888/
  ProxyPassReverse / http://localhost:8888/

  SSLEngine on
  SSLCertificateKeyFile /etc/apache2/mycert/server.key
  SSLCertificateFile /etc/apache2/mycert/server.crt
</VirtualHost>

E o log em /var/log/gitlab/gitlab-rails/production.logme diz isso:

Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 7ms (ActiveRecord: 2.0ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 7ms (ActiveRecord: 4.3ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 6ms (ActiveRecord: 1.8ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 6ms (ActiveRecord: 2.8ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 7ms (ActiveRecord: 2.0ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 5ms (ActiveRecord: 2.3ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 7ms (ActiveRecord: 2.0ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 6ms (ActiveRecord: 2.8ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 7ms (ActiveRecord: 1.9ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 6ms (ActiveRecord: 2.8ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 5ms (ActiveRecord: 0.9ms)
Started GET "/" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by RootController#index as HTML
Completed 401 Unauthorized in 3ms (ActiveRecord: 1.2ms)
Started GET "/users/sign_in" for xxx.xxx.xxx.xxx at 2015-09-24 22:32:40 +0200
Processing by SessionsController#new as HTML
Redirected to https://gitlab.example.com/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 5ms (ActiveRecord: 1.1ms)

Talvez alguém de vocês tenha uma ideia de por que isso está acontecendo?

Atenciosamente, Benni

informação relacionada