0

I'm building an application is based on the Microservices architecture. I have a microservice that uses Spring MVC and a reverse proxy is provided by Zuul. Without Zuul my microservice is accessed by http://localhost/ and with proxy by http://localhost/ui/ . So when I click on a link on the main page I have to go http://localhost/ui/order but I go to http://localhost/order and of course I get "Not found". When a request goes throw Zuul, Zuul adds the headers: X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Prefix (equals /ui/).

I'm using Spring Boot 1.3.2 + Thymeleaf + Tomcat.

Question: How can I configure spring mvc to add prefix to my links or maybe exist another solution?

UPD: I found an interesting behavior. I replaced the link from {/order} to {./order} and when I'm on http://localhost the link has a next href http://localhost/order , but when I'm on http://localhost/ (add /) the link has http://localhost/ui/order . What is this?

Oleg P.
  • 118
  • 1
  • 7
  • have you configure your spring boot app to accept CORS requests? – Luiz E. Mar 21 '16 at 20:48
  • Yes. I allowed all origins, all headers and etc. – Oleg P. Mar 21 '16 at 22:10
  • as to your update: that's simply a relative path (starting with "./") this isnt that surprising. the other issue ... i am having the same. thymeleaf does not consider the "x-forwarded-prefix" header ... :/ – rmalchow Sep 20 '18 at 14:51

0 Answers0