apache - 所有静态内容请求都转到 Jboss EAP 7.1 ,而不是在 Webserver 中查找
问题描述
最近,我从 Jboss EAP 6.4 迁移到了 Jboss EAP 7.1。我在 Jboss EAP 前面有一个 Jboss EWS,通过 mod 集群连接到它们。我使用一些保存在 websever (Jboss EWS) 中的静态内容。在访问网络服务器 URL 时,它用于为网络服务器中的静态内容提供服务。
但是,在迁移到 JBoss EAP 7.1 之后,它正在 Appserver 中寻找静态内容并给出 404。这可能是由于新添加了 undertow,而这在 Jboss EAP 6.x 中没有到位 我应该做什么更改(可能在 undertow config 中),以便它在 webserver 本身而不是 appservers 中查找静态内容。
解决方案
您需要将文件处理程序和另一个位置添加到 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>
推荐阅读
- php - 转换成十进制后的密码比较
- python - 使用 Pycharm 安装 Pillow 失败
- javascript - 如何从firebase数据库中获取密钥
- python - 将字典传递给函数而不更改先前处理的值
- reactjs - 我的 API laravel 在我的 reactjs 上运行时不起作用
- java - 如何比较firestore中的日期
- reactjs - NextJS 9.3 链接不是 JSX 元素的构造函数
- c# - 根据 UserID 显示 UserName
- javascript - 如何在 Node.JS 中多行编写函数的输出
- javascript - react native-有办法将箭头导航图标更改为菜单图标吗?