【发布时间】:2020-02-07 22:17:04
【问题描述】:
每次我在询问 localhost:60001/info、localhost:60001/actuator 或其他人时遇到 404 错误。
{"timestamp":1570711643410,"status":404,"error":"Not Found","message":"No message available","path":"/loginfo"}
它仅适用于localhost:60001/metrics 和localhost:60001/health。
在我的 application.yml 文件中,我添加了所有设置以启用所有可能的端点。
management:
server:
port: 60001
security:
enabled: false
endpoint:
beans:
enabled: true
health:
show-details: ALWAYS
endpoints:
sensitive: true
web:
exposure:
include: *
PS:我也有疑问,为什么我会在application.yml中写管理设置有错误,为什么JAR文件构建成功。例如,show-details: SOME_NOT_EXISTING_THING 而不是 show-details: ALWAYS
我还添加了我在Baeldung tutorial for Spring Boot 2.x Actuator 中看到的SecurityWebFilterChain bean
@Bean
public SecurityWebFilterChain securityWebFilterChain(
ServerHttpSecurity http) {
return http.authorizeExchange()
.pathMatchers("/actuator/**").permitAll()
.anyExchange().authenticated()
.and().build();
}
我尝试了所有可能的localhost:60001/链接,这些链接已经写在这个stackoverflow issue中。
PS:http://hostname:portnumber/applicationroot/actuator/health、http://localhost:60001/loginfo 等。但是还是不行。
我使用 Spring Boot 2.1.6:RELEASE
【问题讨论】:
-
您使用的是哪个 Spring Boot 版本?
-
@Shailesh 我使用 Spring Boot 2.1.6:RELEASE
标签: java spring spring-boot spring-boot-starter