设为首页 收藏本站
查看: 504|回复: 0

[经验分享] squid正向配置

[复制链接]

尚未签到

发表于 2018-12-26 10:39:05 | 显示全部楼层 |阅读模式
  http_port 3128
  logfile_rotate 3
  cache_mem 1024 MB
  cache_swap_low  90
  cache_swap_high 96
  cache_vary on (2.6以上没这个参数了)
  acl apache rep_header Server ^Apache
  broken_vary_encoding allow apache (2.6以上没这个参数了)
  cache_replacement_policy heap GDSF
  cache_dir aufs /opt/squid/cache 4000 16 32
  cache_dir aufs /opt/squid/cachedir/cache01 4000 16 32
  cache_dir aufs /opt/squid/cachedir/cache02 4000 16 32
  cache_log /opt/squid/var/logs/cache.log
  strip_query_terms off
  acl nolog urlpath_regex -i \.dll
  #emulate_httpd_log on
  logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh
  cache_access_log /opt/squid/var/logs/access.log combined !nolog
  access_log /opt/squid/var/logs/newaccess.log
  cache_store_log none
  ipcache_size 1024
  ipcache_low 95
  ipcache_high 95
  fqdncache_size 1024
  hierarchy_stoplist \.jsp
  acl QUERY urlpath_regex \.jsp
  no_cache deny QUERY
  acl cache_object urlpath_regex -i \.jpg$
  acl cache_object urlpath_regex -i \.png$
  acl cache_object urlpath_regex -i \.htm
  acl cache_object urlpath_regex -i \.html
  acl cache_object urlpath_regex -i \.gif$
  acl cache_object urlpath_regex -i \.swf$
  no_cache deny !cache_object
  acl bmsDomain dstdomain .zhaopin.com
  no_cache deny bmsDomain
  minimum_object_size 0 KB
  maximum_object_size 6 MB
  maximum_object_size_in_memory 1024 KB
  memory_replacement_policy heap GDSF
  ftp_user nothing@yahoo.com
  ftp_list_width 256
  dns_children 120
  redirect_children 20
  #authenticate_program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/passwd
  refresh_pattern  ^ftp:  1440  20%  10080
  refresh_pattern  ^gopher:  1440  0%  1440
  refresh_pattern  .  0  20%  4320
  refresh_pattern  -i \.gif$  180  90%  1440 >
  refresh_pattern  -i \.jpg$  180  90%  1440 >
  refresh_pattern -i \.wmv$  1440  90%  2880 >
  refresh_pattern -i \.flv$  1440  90%  2880 >
  refresh_pattern -i \.png$  1440  90%  2880 >
  refresh_pattern -i \.css$  1440  90%  2880 >
  refresh_pattern -i \.swf$  1440  90%  2880 >
  acl all src 0.0.0.0/0.0.0.0 (3.0不要这一行)
  acl manager proto cache_object
  acl FTP proto FTP
  acl specialusers src 192.168.24.14/32
  acl localhost src 127.0.0.1/255.255.255.255
  acl msnmessenger req_mime_type ^application/x-msn-messenger$
  acl msn url_regex -i gateway.dll
  acl denyport port 3000 4000
  acl SSL_ports port 443 563
  acl temp_ports port 5283
  acl Safe_ports port 80 443
  acl Safe_ports port 8010
  acl Safe_ports port 8086
  acl Safe_ports port 8001
  acl Safe_ports port 8080
  acl Safe_ports port 8003
  acl Safe_ports port 8000
  acl Safe_ports port 8888
  acl Safe_ports port 8088
  acl Safe_ports port 7004
  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 Purge method PURGE
  http_access allow Purge localhost
  acl CONNECT method CONNECT
  acl qqserver dst 219.133.0.0/16
  acl qqserverd dstdomain .qq.com .tencent.com
  acl tianya dstdomain .tianya.cn
  acl tianya dstdomain .tianyaclub.com
  acl meebo dstdomain .meebo.com
  acl meebo dstdomain .meebo.com.cn
  acl webqq dstdomain .im.qq.com
  acl webqq1 dstdomain .waysonline.net
  acl myip src 192.168.2.68/32 192.168.2.113/32
  acl kaixin dstdomain .kaixin001.com
  acl kxlive dstdomain .kxlive.com
  acl kaixin dstdomain .kaixin.com
  http_access deny tianya
  http_access deny meebo
  http_access deny kaixin
  http_access deny kxlive
  http_access deny hahapage
  http_access deny webqq
  http_access deny webqq1
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html imhaha
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html tianya
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html meebo
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html kaixin
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html webqq
  acl gamesvr dstdomain .travian.cn .travian.com .travian.hk .travian.china.com
  http_access allow gamesvr myip
  http_access deny gamesvr
  deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html gamesvr
  acl allow_ip src 192.168.2.0/255.255.255.0
  acl allow_ip src 192.168.17.0/24
  acl allow_ip src 192.168.19.0/24
  acl allow_ip src 192.168.20.0/255.255.255.0
  acl allow_ip src 192.168.21.0/255.255.255.0
  acl allow_ip src 192.168.22.0/255.255.255.0
  acl allow_ip src 192.168.23.0/255.255.255.0
  acl allow_ip src 192.168.24.0/255.255.255.0
  acl allow_ip src 192.168.25.0/255.255.255.0
  acl allow_ip src 192.168.26.0/255.255.255.0
  acl allow_ip src 192.168.28.0/255.255.255.0
  acl allow_ip src 192.168.27.0/24
  acl allow_ip src 192.168.29.0/255.255.255.0
  acl cs_deny_ip src 192.168.21.193/32
  acl denyurl url_regex -i ^http://chat
  acl denyurl url_regex -i fastsmuthost.com
  acl denyurl url_regex -i webex.com
  acl denyurl url_regex -i ^http://sohuchat
  acl denyurl url_regex -i icq\.
  acl imhaha  url_regex -i imhaha.com
  #acl denyurl url_regex -i \.qq\.com
  #acl denyurl url_regex -i \.tencent\.com
  acl denyurlpath urlpath_regex -i \.mp3$
  acl denyurlpath urlpath_regex -i \.wma$
  acl denyurlpath urlpath_regex -i \.wmv$
  acl denyurlpath urlpath_regex -i \.rm$
  acl denyurlpath urlpath_regex -i \.exe$
  acl denyurlpath urlpath_regex -i \.scr$
  acl denyurlpath urlpath_regex -i \.pif$
  acl music_denyurlpath urlpath_regex -i \.mp3$
  acl music_denyurlpath urlpath_regex -i \.wam$
  acl video_denyurlpath urlpath_regex -i \.wmv$
  acl video_denyurlpath urlpath_regex -i \.rm$
  acl soft_denyurlpath urlpath_regex -i \.exe$
  acl soft_denyurlpath urlpath_regex -i \.scr$
  acl soft_denyurlpath urlpath_regex -i \.pif$
  acl worktime time 8:45-12:00
  acl worktime time 13:00-18:00
  acl qquserlst src "/opt/squid/etc/policy/qquserlst"
  acl qqsvrlist dst "/opt/squid/etc/policy/qqsvriplist"
  acl qqsvrlist02 dstdomain "/opt/squid/etc/policy/qqsvrdomainlist"
  acl download5Mb src "/opt/squid/etc/policy/download5Mb"
  acl download10Mb src "/opt/squid/etc/policy/download10Mb"
  acl download20Mb src "/opt/squid/etc/policy/download20Mb"
  acl download40Mb src "/opt/squid/etc/policy/download40Mb"
  acl download50Mb src "/opt/squid/etc/policy/download50Mb"
  acl download100Mb src "/opt/squid/etc/policy/download100Mb"
  acl download200Mb src "/opt/squid/etc/policy/download200Mb"
  acl download500Mb src "/opt/squid/etc/policy/download500Mb"
  acl downloadexefile src "/opt/squid/etc/policy/downloadexefile"
  acl CONNECTip src "/opt/squid/etc/policy/CONNECTip"
  acl music_denyurlpathIP  src "/opt/squid/etc/policy/music_denyurlpath"
  acl video_denyurlpathIP  src "/opt/squid/etc/policy/video_denyurlpath"
  acl soft_denyurlpathIP  src "/opt/squid/etc/policy/soft_denyurlpath"
  acl denyurlIP  src "/opt/squid/etc/policy/denyurlpath"
  reply_body_max_size 5242880 allow download5Mb
  reply_body_max_size 10485760 allow download10Mb
  reply_body_max_size 20971520 allow download20Mb
  reply_body_max_size 52428800 allow download50Mb
  reply_body_max_size 104857600 allow download100Mb
  reply_body_max_size 209715200 allow download200Mb
  reply_body_max_size 524288000 allow download500Mb
  reply_body_max_size 41943040 allow download40Mb
  reply_body_max_size 5000000 allow specialusers !worktime
  reply_body_max_size 1048576 allow all
  http_access deny denyip
  http_access allow denyurlpath denyurlIP
  http_access allow music_denyurlpath music_denyurlpathIP
  http_access allow video_denyurlpath video_denyurlpathIP
  http_access allow soft_denyurlpath soft_denyurlpathIP
  http_access allow soft_denyurlpath downloadexefile
  http_access allow manager localhost
  http_access deny manager
  http_access allow CONNECT qquserlst qqsvrlist qqsvrlist02
  http_access allow CONNECT CONNECTip
  http_access allow CONNECT it-harvey
  http_access deny CONNECT qqserverd
  http_access deny CONNECT qqserver
  http_access deny CONNECT qqsvrlist
  http_access deny CONNECT qqsvrlist qqsvrlist02
  http_access allow FTP myip
  http_access deny FTP
  http_access allow temp_ports
  http_access deny denyport
  http_access deny !Safe_ports
  http_access deny CONNECT !SSL_ports
  http_access deny icqip
  http_access deny denyurl
  http_access deny denyurlpath
  http_access deny cs_deny_ip msnmessenger
  http_access deny cs_deny_ip msn
  http_access allow allow_ip
  http_access allow allow_ip msnmessenger
  http_access deny all
  icp_access allow all
  miss_access allow all
  proxy_auth_realm zp_admin
  cache_mgr admin@zhaopin.com.cn
  cache_effective_user squid
  cache_effective_group squid
  visible_hostname squid-test
  snmp_port 3401
  acl Snmppublic snmp_community public
  acl Adminhost src 192.168.2.158
  snmp_access allow Adminhost Snmppublic
  /opt/squid/sbin/squid -v
  '--prefix=/opt/squid' '--enable-async-io=40' '--enable-storeio=aufs,coss,diskd,ufs' '--enable-useragent-log' '--enable-referer-log' '--enable-kill-parent-hack' '--enable-forward-log' '--enable-snmp' '--enable-cache-digests' '--enable-default-err-language=Simplify_Chinese' '--enable-epoll' '--enable-removal-policies=heap,lru' '--enable-large-cache-files' '--disable-internal-dns' '--enable-x-accelerator-vary' '--enable-follow-x-forwarded-for' '--with-large-files' '--disable-ident-lookups' '--enable-underscore' '--disable-arp-acl' '--with-maxfd=65500'


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-655996-1-1.html 上篇帖子: squid集群,cdn 下篇帖子: squid错误排查
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表