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?