503服务不适用于鱿鱼

时间:2019-02-01 13:56:06

标签: squid

我正在尝试在Google云引擎上设置鱿鱼,但每个网站都得到503 Service Unavailable

curl -x http://35.xx.xxx.xxx:62401   -I http://www.squid-cache.org/Support/
HTTP/1.1 503 Service Unavailable
Server: squid
Mime-Version: 1.0
Date: Fri, 01 Feb 2019 13:45:15 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3670
X-Squid-Error: ERR_CONNECT_FAIL 101
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from google_proxyv1
X-Cache-Lookup: MISS from google_proxyv1:62401
Connection: keep-alive

我将鱿鱼conf剥离到以下最低限度

acl CONNECT method CONNECT
http_access allow CONNECT 
# And finally allow all  access to this proxy
http_access allow all
# Squid port
http_port 0.0.0.0:62401
debug_options ALL,1 5,5
request_header_access User-Agent deny all
request_header_replace Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari
/537.36
tcp_outgoing_address 35.xx.xxx.xxx
cache_access_log /var/log/squid/access.log
httpd_suppress_version_string on
cache_store_log none
shutdown_lifetime 1 second
icp_port 0
htcp_port 0
icp_access deny all
htcp_access deny all
snmp_port 0
snmp_access deny all
memory_pools off
via off
forwarded_for delete
follow_x_forwarded_for deny all
pipeline_prefetch on
request_header_access From deny all
request_header_access Server deny all

乌贼正在听ipv4,因为我只保留了一个ipv4地址

sudo netstat -antp | grep squid

tcp        0      0 0.0.0.0:62401           0.0.0.0:*               LISTEN      16811/(squid-1)   

但是访问日志显示它仍然尝试连接到ipv6地址

1549028715.317      3 35.xx.xxx.xxx TCP_MISS/503 357 HEAD http://www.squid-cache.org/Support/ - HIER_DIRECT/2001:4800:7812:514:be76:4eff:fe04:5ca1

我已经在Google云引擎上打开62401 tcp

2 个答案:

答案 0 :(得分:2)

尝试禁用IPv6

dns_v4_first on

答案 1 :(得分:0)

我必须删除tcp_outgoing_address并添加dns_v4_first on