我正在使用我的mac与XAMPP从标准configuration的apachefriends 。
我想使用反向代理,所以我编辑了etc/extra/proxy-html.conf并添加了以下内容:
ProxyRequests Off ProxyPass /my-gateway/ http://interner.server.test/ <Location /my-gateway/> ProxyPassReverse / ProxyHTMLEnable On ProxyHTMLURLMap http://interner.server.test/ /my-gateway/ ProxyHTMLURLMap / /my-gateway/ </Location>
现在,当我去localhost/my-gateway ,我得到Error 404 Object not found 。
如何找出为什么这不起作用?
首先:我不认为你需要像ProxyHTMLURLMap的一个简单的反向代理。
其次:尝试一个localhost/my-gateway / (与结束斜线!)。 它工作吗?
第三:这是一个可靠的configuration片段:
<VirtualHost *:80> ServerName your.proxy.vhost.name ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On ProxyPass /my-gateway/ http://interner.server.test/ </VirtualHost>
出于<VirtualHost应该也适用。 这个<Proxy指令也是需要的。