在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
答案 0 :(得分:0)
尝试替换包含的服务器名称:
<VirtualHost backend.aonesalons.com:80>
这应该有效,而不是经过测试。将此更改应用于这两个条目。我不确定顺序 - 正确的* .domain.de最后因为它将被处理然后配置不再被阅读