analytics

2011年5月31日星期二

squid做二级代理的配置

折腾好了squid在ubuntu上做二级代理,mark一下 
http_port 192.0.3.123:3128                       #本机地址,端口
visible_hostname tango.proxy
cache_dir null /tmp
cache_mem 32 MB
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log   


cache_swap_low 90
cache_swap_high 95
client_netmask 255.255.255.255
cache_peer 192.0.0.27 parent 808 446 default no-query  #192.0.0.27是本机需要使用的代理服务器,808 is port

acl tango src 192.0.3.214/32                         #被允许使用本机做代理的机器的IP
acl all src 0.0.0.0/0
acl manager proto cache_object
acl SSL_ports port 443 563 1025-65535
acl Safe_ports port 80
acl Safe_ports port 443 564 1025-65535 #https
acl Safe_ports port 21    #ftp
acl Safe_ports port 70
acl Safe_ports port 210 
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe-ports port 777
acl CONNECT method CONNECT
acl prolist proto HTTP FTP SMTP HTTPS
cache_peer_access 192.0.0.27 allow tango
http_access allow tango
http_access allow prolist
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports 
never_direct allow all                                        #转发所有请求,必须得,否则https等无法连接


squid -k parse      验证配置是否正确  
service squid start
service squid stop

没有评论:

发表评论