我的Spring服务器上下文-path: /test
我使用nginx配置为"https://localhost:8443/test“基路径设置了身份验证,这个基本路径中的rest是边缘服务。
问题:我不希望我的健康服务暴露为边缘服务,并接受认证。但是执行器的健康检查是作为管理服务提供的,管理员的上下文路径没有覆盖应用程序的基本路径。
在我的应用程序中,有什么调整可以用来区分rest和执行器的健康检查api的上下文路径吗?
Dropwizard很容易做到这一点。
发布于 2017-10-16 21:30:07
您可以使用spring安全性来保护管理端点:
将spring-boot-starter-security
添加到依赖项中:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
这本身将确保所有端点的安全。如果只希望保护mgmt属性,请添加以下属性:
security.basic.enabled=false
还可以为此设置不同的用户/密码:
security.user.name=admin
security.user.password=new_password
贷给这个职位
https://stackoverflow.com/questions/46779238
复制相似问题