【问题标题】:All static content requests going to Jboss EAP 7.1 , instead of looking in Webserver所有静态内容请求都发送到 Jboss EAP 7.1,而不是在 Webserver 中查找
【发布时间】:2018-11-12 16:34:35
【问题描述】:
最近,我从 Jboss EAP 6.4 迁移到 Jboss EAP 7.1。
我在 Jboss EAP 前面有一个 Jboss EWS,通过 mod 集群连接到它们。
我使用一些保存在 websever (Jboss EWS) 中的静态内容。
在访问 webserver URL 时,它用于在 websever 中提供静态内容。
然而,在迁移到 JBoss EAP 7.1 之后,它在 Appserver 中寻找静态内容并给出 404。这可能是由于新添加了 undertow,这在 Jboss EAP 6.x 中没有到位
我应该做哪些更改(可能在 undertow 配置中),以便它在网络服务器本身而不是应用服务器中查找静态内容。
【问题讨论】:
标签:
apache
http-status-code-404
undertow
jboss-eap-7
mod-cluster
【解决方案1】:
您需要在standalone.xml 中将文件处理程序和另一个位置添加到undertow 子系统以提供静态内容(如图像):
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/img" handler="images"/>
</host>
</server>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
<file name="images" path="/var/images" directory-listing="true"/>
</handlers>