配置squid代理服务器(不会连接,说检查代理设置)

时间:2017-05-09 00:43:44

标签: ubuntu proxy squid

所以我在亚马逊Ubuntu服务器上安装了squid。

经过几个小时的错误后,我终于正确地设置了我在检查时遇到错误的地方

" sudo service squid status"和" sudo du -sh / var / spool / squid"

我还跑了" telnet localhost 3128"我正确连接。它输出

"Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'." 

所以我知道它运行正常。

但是当我尝试通过chrome连接到我的代理时,我根本无法连接。

我的squid.conf文件看起来像这样

"acl network src 172.31.15.0/255.255.240.0


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 allow localhost
http_access allow network

http_access deny all


cache_dir ufs /var/spool/squid 5120      16      256
refresh_pattern -i \.(gif|png|jpg|jpeg|ico)$ 3600       90% 43200


http_port 3128

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
"

我的ifconfig设置如下:

    Link encap:Ethernet  HWaddr 0a:d9:f6:3e:71:1f  
          inet addr:172.31.15.87  Bcast:172.31.15.255  Mask:255.255.240.0
          inet6 addr: fe80::8d9:f6ff:fe3e:711f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:9001  Metric:1
          RX packets:61285 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29289 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8446123 (8.4 MB)  TX bytes:5999460 (5.9 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2613 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2613 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:266006 (266.0 KB)  TX bytes:266006 (266.0 KB)

0 个答案:

没有答案