在使用 AJP 代理 Tomcat 时,我在为 Windows 计算机创建子域时遇到问题。这是我的 httpd.conf 文件中的内容:
<VirtualHost *:80>
ServerName subdomain.localhost
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/folder/
ProxyPassReverse / ajp://localhost:8009/folder/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
子域已添加到 `c:\windows\system32\drivers\etc\hosts
127.0.0.1 本地主机
127.0.0.1 子域名.localhost
当我去http://localhost
我直接去代理。当我去http://subdomain.localhost
我也去代理。我该如何使子域仅转到代理,而常规域转到 Apache?
您需要声明第二个 VirtualHost,并将 localhost 作为 ServerName。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)