Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G gitlab-ce
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedinexedi
  • gitlab-ce
  • Repository
  • gitlab-ce
  • lib
  • gitlab
  • request_context.rb
Find file BlameHistoryPermalink
  • Stan Hu's avatar
    Fix health checks not working behind load balancers · 01203e71
    Stan Hu authored Mar 12, 2019
    The change in
    https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24199 caused
    requests coming from a load balancer to arrive as 127.0.0.1 instead of
    the actual IP.
    
    `Rack::Request#ip` behaves slightly differently different than
    `ActionDispatch::Request#remote_ip`: the former will return the first
    X-Forwarded-For IP if all of the IPs are trusted proxies, while the
    second one filters out all proxies and falls back to REMOTE_ADDR, which
    is 127.0.0.1.
    
    For now, we can revert back to using `Rack::Request` because these
    middlewares don't manipulate parameters. The actual fix problem involves
    fixing Rails: https://github.com/rails/rails/issues/28436.
    
    Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58573
    01203e71
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7