I am running my springboot application by setting context-path to /myservice. This results into appending all my actuator endpoints exposed at the URL- http://localhost:8080/myservice/actuator/, while I want only http://localhost:8080/actuator/. Is there a way to tell the springboot to ignore appending context path to actuator endpoints (through DispatcherServlet or CXFServlet or anything) Please help.
SpringBoot adds context path to Actuator endpoints
3.4k views Asked by Shridha Jalihal At
2
There are 2 answers
0
On
Technically it is not possible because spring boot has only one DispatcherServlet which is a front controller, if you want two different paths then you can use @RequestMapping annotation on two different controllers`
Still of you want two different context-paths then you should have two DispatcherServlet's
Unfortunately this is not possible.
From the documentation:
Source: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.monitoring.customizing-management-server-context-path
What you could do is to use a different port for the management endpoints.
Then you will get http://localhost:8081/actuator