Closed mvysny closed 1 year ago
Yup I need to set the nginx.ingress.kubernetes.io/proxy-redirect-from
and nginx.ingress.kubernetes.io/proxy-redirect-to
manually since they're by default off, as per kubernetes ingress nginx documentation.
I need to rewrite a request from https://v-herd.eu/login
to https://v-herd.eu/app/login
. I think the correct values for them are:
nginx.ingress.kubernetes.io/proxy-redirect-from
: https://v-herd.eu/login
nginx.ingress.kubernetes.io/proxy-redirect-to
: https://v-herd.eu\$1/login
That works, but the follow-up redirect request on successful login ends up at https://v-herd.eu/
.
I think I need to generify the rule to redirect https://v-herd.eu
to https://v-herd.eu\$1
That worked well! The correct rules for Spring Security are therefore:
nginx.ingress.kubernetes.io/proxy-redirect-from
: https://v-herd.eu/
nginx.ingress.kubernetes.io/proxy-redirect-to
: https://v-herd.eu\$1
I'll update readme
When deploying a Spring Boot app with Spring Security, new user gets redirected to the
/login
page by Spring. It's done by emitting a HTTP 302 with Location set tohttps://v-herd.eu/login
, which of course doesn't work.We need to configure Kubernetes Ingress (Nginx) to rewrite the Location in HTTP 302 requests. Couple of pointers: