2

我想将这样的请求重定向http://myproxy.com/site:5000/response-headers/action?Content-Length=30http://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.comhttp://site.com它可以正常工作。

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

非常感谢。

4

0 回答 0