Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9222

Closed
Open
Created Apr 29, 2015 by Administrator@rootOwner

No redirect after login, but 'Location: /' is set

Created by: jedix

After manually installing GitLab on Debian 8.0 I get the wrong HTTP response code after login. Everything else seems to work.

Steps to reproduce:

  1. go to https://www.example.com/users/sign_in
  2. enter valid credentials and submit the login form
  3. no redirect happens (HTTP status code: 200) but HTTP header Location is set to /
  4. browser ignores location header because of status code and displays login page again
  5. enter https://www.example.com/ manually -> you see the dashboard

My setup: Gitlab 7.10 sits behind an apache proxy, I'm using SSL with trusted certificates.

gitlab.yml

  gitlab:
    host: www.example.com
    port: 443
    https: true

virtualhost:

Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains"
SSLCompression Off
ServerSignature Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode

<Location />
  Require all granted
  ProxyPassReverse http://127.0.0.1:8080
  ProxyPassReverse http://www.example.com/
</Location>

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
RequestHeader set X_FORWARDED_PROTO 'https'
DocumentRoot /home/git/gitlab/public

production.log

Started GET "/users/sign_in" for some-ip at 2015-04-29 11:13:20 +0200
Processing by SessionsController#new as HTML
Completed 200 OK in 20ms (Views: 7.2ms | ActiveRecord: 1.2ms)
Started POST "/users/sign_in" for some-ip at 2015-04-29 11:13:22 +0200
Processing by SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"login"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}}
Completed 200 OK in 117ms (Views: 6.7ms | ActiveRecord: 16.2ms

On my old server, the production log shows 302 instead of 200 and everything works as expected (but this is GitLab 7.4):

Started GET "/users/sign_in" for some-ip at 2015-04-29 10:36:24 +0200
Processing by SessionsController#new as HTML
Completed 200 OK in 149ms (Views: 135.3ms | ActiveRecord: 0.0ms)
Started POST "/users/sign_in" for some-ip at 2015-04-29 10:36:26 +0200
Processing by SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"AQtzko/SFt5kf9UHcxBu+/7OS9Kv0tTpLNZkFiBWLOk=",            "user"=>{"login"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}}
Redirected to https://www.example.com/
Completed 302 Found in 233ms (ActiveRecord: 74.6ms)
Started GET "/" for some-ip at 2015-04-29 10:36:26 +0200
Processing by DashboardController#show as HTML
Completed 200 OK in 110ms (Views: 68.9ms | ActiveRecord: 9.0ms)

If more information is needed, I am happy to provide it. The problem does not seem to be the proxy setup because tunneling port 8080 over ssh and resolving the domain to 127.0.0.1 on my local machine also gives no redirect.

Assignee
Assign to
Time tracking