怎么在springboot admin的界面自带的接口的路径前添加前缀?如原来的接口是ip+port+applications拼接现在想换成统一加前缀monitor变成ip+port+monitorapplications该怎么实现?
可以通过配置Spring Boot Admin Server的Context Path来实现添加前缀的功能。具体步骤如下:
- 在application.properties文件中添加以下配置:
server.servlet.context-path=/monitor
-
启动Spring Boot Admin Server,访问ip+port+/monitor即可进入Spring Boot Admin的界面。
-
在界面中访问应用程序列表时,路径会自动添加前缀“/monitor”。
注意:如果应用程序的路径也需要添加前缀,需要在应用程序的配置文件中添加相应的配置。例如:
server.servlet.context-path=/myapp
这样访问应用程序时,路径就会变成ip+port+/monitor/myapp。
原文地址: https://www.cveoy.top/t/topic/K9z 著作权归作者所有。请勿转载和采集!