JBoss 虚拟主机和上下文根

时间:2021-07-05 09:20:52

标签: java jboss wildfly virtualhost

在我的 jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web version="8.0" xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/schema/jbossas/jboss-web_8_0.xsd">
    <context-root>SampleSpringBoot</context-root>
    <virtual-host>SampleSpringBoot</virtual-host>
</jboss-web>

独立文件.xml

<host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                    <http-invoker security-realm="ApplicationRealm"/>
                </host>
    <host name="SampleSpringBoot" alias="123.mydomain.com" default-web-module="SampleSpringBoot.war"/>

当我访问“123.mydomain.com”时,我可以查看应用程序索引页面。

当我访问“http://localhost:8080/SampleSpringBoot”时,它不工作404返回

我试过

<host name="SampleSpringBoot" alias="123.mydomain.com, SampleSpringBoot" default-web-module="SampleSpringBoot.war"/> 

相同的 404 返回

如何在本地访问网址?

谢谢

0 个答案:

没有答案