I\'ve been trying to get to the bottom of a strange redirection issue for the past 2 days without success.
Based on the spring-cloud example projects, I\'ve configured E
As you can see RedirectView ignores X-FORWARDED-*
headers.
Simply put, you can't use "redirect:/account"
.
Instead instantiate a RedirectView
and configure it accordingly:
RedirectView redirect = new RedirectView("account");
redirect.setHosts(new String[]{ request.getHeader("X-FORWARDED-HOST") });
Since Spring Framework 4.3 (currently RC1) setHosts method is available.
If you are using tomcat as embeded server in your backend app, you could use this settings (application.properties, yml, etc):
server.tomcat.remote_ip_header=x-forwarded-for
server.tomcat.protocol_header=x-forwarded-proto
Or more generic way:
server.use-forward-headers=true