wildfly 如何设置外网访问

时间:2021-11-22 14:39:02

wildfly的默认配置是不支持外网访问的,

要想实现外网访问需要修改standalone.xml配置文件。

配置文件所在路径:wildfly/standalone/configuration/standalone.xml

看到是要访问public(8080端口的)和management的interface,将interface中的对应绑定地址127.0.0.1改为0.0.0.0即可。

修改前:

<interfaces>

<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.0}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.0}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>

修改后:

<interfaces>

<interface name="management">
<inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>