技术解析

squid 配置问题:反向代理无法访问 HTTP 网站
0
2021-06-30 11:45:39
idczone

手里有一批临时代理,打算全部丢进squid做反向代理,让squid自动隔离那些失效的代理; 但是配置了2天了,一直不生效,头疼。。。。

下面这个是配置

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny manager
http_access allow all
http_access allow localhost
http_access deny all
http_port 8888
coredump_dir /var/spool/squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern (Release|Packages(.gz)*)$      0       20%     2880
refresh_pattern .               0       20%     4320

# visible_hostname haha
via off
forwarded_for delete
# forwarded_for off
#follow_x_forwarded_for deny all
#request_header_access X-Forwarded-For deny all
#request_header_access From deny all
#request_header_access Referer deny all
#request_header_access User-Agent deny all
# request_header_access Via deny all

###cache_peer start

cache_peer 112.193.71.239 parent 8888 0 no-query weighted-round-robin weight=1 connect-fail-limit=2 allow-miss max-conn=5 name=119.122.93.112820

never_direct allow all

除了能访问百度搜索结果页以外,其它网站都访问不了。

返回的提示是这样的:

当尝试取回该 URL 时遇到下面的错误: http://tieba.baidu.com/p/4967277133?

    目前无法将您的请求进行转送操作

可能的问题包括:

缓存服务器的管理员 webmaster.


已解决!
见: https://www.v2ex.com/t/252805#reply8

你好,你好怎么处理呢?配置文件怎么设置

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服