在使用mod_proxy时,可以不向客户端发送301个移动的永久响应吗?我希望客户尽可能不透明地处理反向代理。
我的虚拟主机设置:相关片段:
ProxyPreserveHost On
ProxyPass /GTM http://192.168.1.27/GTM
ProxyPassReverse /GTM http://192.168.1.27/GTMwget localhost/GTM:
--2011-09-27 21:54:22-- localhost/GTM
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... failed: Connection refused.
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: localhost/GTM/ [following]
--2011-09-27 21:54:22-- localhost/GTM/
Reusing existing connection to localhost:80.
HTTP request sent, awaiting response... 200 OK发布于 2011-09-27 16:19:46
除非你用RewriteRule ... [R=301]或Redirect告诉它,否则Apache不会生成301。
您要代理的服务器是生成重定向的服务器。尝试在Apache中设置ProxyPreserveHost On,以防应用程序试图强制使用特定的主机名。
https://serverfault.com/questions/316007
复制相似问题