【发布时间】:2018-02-14 08:15:07
【问题描述】:
我正在尝试将 Apache 服务器配置为具有 2 个使用反向代理的子域。我能够将流量重定向到第一个子域 (first.example.com) 并成功从 https 站点检索内容。但是,每当我尝试访问第二个子域时,我最终都会从第一个子域获取内容,并且由于路由与我的本地网站不匹配,我会得到一个未找到的页面。
我想知道我可以从我当前的配置中调整什么,以便我可以从我的本地主机站点获取内容。
这是我当前的配置:
<Proxy *>
Require all granted
</Proxy>
SSLProxyEngine On
ProxyRequests Off
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off
SSLInsecureRenegotiation on
SSLProxyVerify none
SSLVerifyClient none
SSLProxyCheckPeerName off
<VirtualHost first.example.com:80>
ServerName first.example.com
ProxyPass /first https://stackoverflow.com
ProxyPassReverse /first https://stackoverflow.com
ProxyPassMatch ^/(.*)$ https://stackoverflow.com/$1
</VirtualHost>
<VirtualHost second.example.com:80>
ServerName second.example.com
ProxyPass /site http://localhost/site
ProxyPassReverse /site http://localhost/site
ProxyPassMatch ^/(.*)$ http://localhost/site/$1
</VirtualHost>
非常感谢您!
最好的问候!
埃德加·马丁内斯。
【问题讨论】:
标签: apache reverse-proxy virtualhost