There is an application myapp (Spring Boot 1.4.1) and the corresponding myapp.war. War is deployed to Tomcat 8.5.9 and the application becomes available at http://127.0.0.1:8080/myapp/ . I want the application to be available at http://127.0.0.1:8081/ . For this, a config is written to Nginx:
server { listen 127.0.0.1:8081; location / { proxy_pass http://127.0.0.1:8080/myapp/; } } The page becomes available, but redirects in the code:
ModelAndView response = ... response.setViewName("redirect:/hello/"); they still stick myapp , that is, the redirect goes to page 127.0.0.1:8081/myapp/hello/ .
The situation is similar with the template engine Thymeleaf. Links like @ {/ hello /} are converted to / myapp / hello. With him, the problem can be solved through the crutch @ {~ / hello /}. But the problem is somewhere else.
http://127.0.0.1:8080/. Do you have such an opportunity? - RomanHostheader to tomcat (proxy_set_header Host $host;for example). - Roman