4.5.8. 默认 Web 模块行为的更改
在 JBoss EAP 7.0 中,mod_cluster 中默认禁用了 Web 应用的根上下文。
自 JBoss EAP 7.1 起,情况已不再如此。如果您希望禁用根上下文,这可能会造成意外的后果。例如,可以将请求错误路由到不合要求的节点,或者不应公开的私有应用可以通过公共代理意外访问。Undertow 位置现在会自动注册到 mod_cluster 负载平衡器,除非被明确排除。
使用以下管理 CLI 命令,将 ROOT 从 modcluster
子系统配置中排除:
/subsystem=modcluster/mod-cluster-config=configuration:write-attribute(name=excluded-contexts,value=ROOT)
/subsystem=modcluster/mod-cluster-config=configuration:write-attribute(name=excluded-contexts,value=ROOT)
使用以下管理 CLI 命令,禁用默认的欢迎 Web 应用:
/subsystem=undertow/server=default-server/host=default-host/location=\/:remove /subsystem=undertow/configuration=handler/file=welcome-content:remove reload
/subsystem=undertow/server=default-server/host=default-host/location=\/:remove
/subsystem=undertow/configuration=handler/file=welcome-content:remove
reload
有关如何配置默认欢迎 Web 应用程序的更多信息,请参阅 JBoss EAP 开发指南中的配置 https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html-single/development_guide/#configure_the_default_welcome_Web_application 默认欢迎 Web 应用。