spring_reference/V. Spring Boot Actuator/41.3. Customizing the manag...

14 lines
886 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 41.3. 自定义管理服务器的端口
对于基于云的部署使用默认的HTTP端口暴露管理端点endpoints是明智的选择。然而如果你的应用是在自己的数据中心运行那你可能倾向于使用一个不同的HTTP端口来暴露端点。
`management.port`属性可以用来改变HTTP端口
```java
management.port=8081
```
由于你的管理端口经常被防火墙保护不对外暴露也就不需要保护管理端点即使你的主要应用是安全的。在这种情况下classpath下会存在Spring Security库你可以设置下面的属性来禁用安全管理策略management security
```java
management.security.enabled=false
```
如果classpath下不存在Spring Security那也就不需要显示的以这种方式来禁用安全管理策略它甚至可能会破坏应用程序。