带有参数的Apache mod_proxy重定向url

时间:2013-09-03 11:30:51

标签: apache url parameters mod-proxy

我想将此http://myproxy.com/site:5000/response-headers/action?Content-Length=30之类的请求重定向到http://site:5000/response-headers/action?Content-Length=30。 我使用mod_proxy和我的配置apache:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so
        ProxyRequests Off
        ProxyPreserveHost On
         <proxy *>
         Order deny,allow
         Allow from all
         </proxy>

ProxyPass /site:5000/response-headers/action?Content-Length=30  http://site:5000/response-headers/action?Content-Length=30 
ProxyPassReverse /site:5000/response-headers/action?Content-Length=30  http://site:5000/response-headers/action?Content-Length=30 

当我尝试请求http://myproxy.com/site:5000/response-headers/action?Content-Length=30时,我看到了这个错误:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /site:5000/response-headers/action.

Reason: DNS lookup failure for: response-headers

在apache日志中:

[error] [client 10.1.76.95] proxy: DNS lookup failure for: response-headers returned by /site:5000/response-headers/action
[debug] proxy_util.c(2029): proxy: HTTP: has released connection for (*)
[debug] mod_deflate.c(615): [client 10.1.76.95] Zlib: Compressed 610 to 366 : URL /site:5000/response-headers/action

例如,如果我将重定向从http://myproxy.com/site.com设置为http://site.com,则可以正常工作。

我如何设置apache和mod_proxy来解决我的问题?

非常感谢。

0 个答案:

没有答案