title: Spring security redirects behind reverse proxy in kubernetes
body: <p>I have Spring Security application deployed in kubernetes without servlet context path.
  In ingress (nginx reverse proxy) I have rewrite rule:</p>
  
  <p>for example /api/oauth-server/authorize -> /authorize</p>
  
  <p>so my login page should be accessed via www.example.com/api/oauth-server/login from outside, but Spring Security redirects me to www.example.com/login. It is because my login page is on /login in application. I want Spring Security redirect me to www.example.com/api/oauth-server/login</p>
  
  <p>How to solve this redirect issue behind the reverse proxy to make it work? This should be common issue, but I did not find any resource with practical info.</p>