+ -
当前位置:首页 → 问答吧 → apache httpd 代理: Reason: DNS lookup failure for: 127.0.0.1

apache httpd 代理: Reason: DNS lookup failure for: 127.0.0.1

时间:2011-12-12

来源:互联网

centos6.0 + apache 2.2 + tomcat6

tomcat 6 运行: http://127.0.0.1:8080 提供服务 http://127.0.0.1:8080/test 本地可以访问

apache httpd.conf 配置代理:

NameVirtualHost *:80
<VirtualHost *:80>
  ServerName localhost
  DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
  ServerName myhost.com
  ServerAlias www.myhost.com

  ProxyPass / http://127.0.0.1:8080
  ProxyPassReverse / http://127.0.0.1:8080
</VirtualHost>

然后访问 http://myhosts.com/test 提示:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /test.
Reason: DNS lookup failure for: 127.0.0.1:8080test

我关闭了防火墙,.selinux 都不可以, 为什么?

作者: muiz   发布时间: 2011-12-12

可以了:
 ProxyPass / http://127.0.0.1:8080
  ProxyPassReverse / http://127.0.0.1:8080

最后要加/
 ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/

作者: muiz   发布时间: 2011-12-12

热门下载

更多