从Ubuntu 16.04升级到18.04后Squid代理无法正常工作

时间:2019-01-24 14:52:41

标签: ubuntu proxy ubuntu-16.04 ubuntu-18.04 squid

我正在使用以下squid.conf

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 Safe_ports port 9100        # printer
acl Safe_ports port 427         # udp port for printer
acl Safe_ports port 137         # udp port for printer
acl Safe_ports port 161         # udp port for printer
acl Safe_ports port 123         # udp port for NTP
acl Safe_ports port 2159         # udp port for gdb
acl CONNECT method CONNECT
acl whitelist dstdomain "/etc/squid/whitelist.txt"
#http_access deny !whitelist
#http_access deny !Safe_ports
#http_access deny CONNECT !SSL_ports
#acl IP_whitelist src 172.16.140.34
#http_access allow IP_whitelist
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access deny all
http_port 3128
coredump_dir /var/spool/squid3
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
request_header_add X-Custom-Caller "Alfarhan-System-Image/1.1" all
include /etc/squid/conf.d/*.conf

该配置可在Ubuntu 16.04上使用,但是升级到Ubuntu 18.04后,我无法访问列入白名单的网站。

以下几行来自squid的访问日志:

1548355758.020      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355758.020      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355758.021      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355758.022      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.119      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.402      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.416      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.433      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.435      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355777.437      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -
1548355787.873      0 127.0.0.1 TAG_NONE/503 0 CONNECT clients1.google.com:443 - HIER_NONE/- -

请在这里帮助我:(

0 个答案:

没有答案