服务器

时间:2018-01-13 16:25:24

标签: apache httpd.conf

在httpd.conf中,我有

NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName *.aonesalons.com
        ProxyPreserveHost On
        # setup the proxy
        <Proxy *>
            Order allow,deny
            Allow from all
        </Proxy>
        ProxyPass / http://localhost:9000/
        ProxyPassReverse / http://localhost:9000/
    </VirtualHost>

    <VirtualHost *:80>
        ServerName backend.aonesalons.com
        ProxyPreserveHost On
        # setup the proxy
        <Proxy *>
            Order allow,deny
            Allow from all
        </Proxy>
        ProxyPass / http://localhost:11000/
        ProxyPassReverse / http://localhost:11000/
    </VirtualHost>

我打算将所有子域的请求转到9000端口,但backend.aonesalons.com应该转到11000端口。

我尝试使用上述规则进行例外处理。

所有东西都被送到9000端口。但backend.aonesalons.com无法正常工作。

我们如何解决这个问题?

编辑:

<VirtualHost backend.aonesalons.com:80>
    ServerName backend.aonesalons.com
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:11000/
    ProxyPassReverse / http://localhost:11000/
</VirtualHost>

<VirtualHost *:80>
    ServerName *.aonesalons.com
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:9000/
    ProxyPassReverse / http://localhost:9000/
</VirtualHost>

我仍然得到404

1 个答案:

答案 0 :(得分:0)

尝试替换包含的服务器名称:

<VirtualHost backend.aonesalons.com:80>

这应该有效,而不是经过测试。将此更改应用于这两个条目。我不确定顺序 - 正确的* .domain.de最后因为它将被处理然后配置不再被阅读

相关问题