首页 > squid > 发一个自己用的squid.conf

发一个自己用的squid.conf

2010年9月10日 eric 发表评论 阅读评论

squid 3.1.X 有段时间了,发一个简单的配置文件:

squid $> cat /usr/local/squid/etc/squid.conf
visible_hostname nginxs.com
cache_effective_user www
cache_effective_group www

acl Safe_ports port 80
acl host dstdomain www.ninxs.com
acl localhost src 127.0.0.1/255.255.255.255
acl snmp src 192.168.6.102/255.255.255.255
acl manager proto cache_object
acl CONNECT method CONNECT
acl PURGE method PURGE

http_access allow manager localhost            # 只允许 本地访问 manager
http_access allow PURGE localhost               # 只允许 本地访问 PURGE
http_access deny manager                         # 其他的一律拒绝访问 manager
http_access deny !Safe_ports                     # 其他不是设置的 安全端口一律拒绝
http_access allow host                              # 只允许反向大代理 host = www.nginxs.com 域名站点
http_access deny all                                  # 其他的一律拒绝

http_port 80 accel vhost vport
cache_peer 124.42.10.51  parent 3128 0 no-query originserver name=nginx
cache_peer_domain tuokou www.nginxs.com
cache_dir ufs /usr/local/squid/var/cache 10000 12 128
cache_mem 2048 MB
max_open_disk_fds 0
minimum_object_size 0 KB
maximum_object_size 32 MB
maximum_object_size_in_memory 2048 KB
cache_swap_low 80
cache_swap_high 85
cache_store_log none

#acl QUERY urlpath_regex cgi-bin
acl nginxs urlpath_regex ^/eric/video/Grec\.php       #动态连接拿视频  例如 http://www.nginxs.com/eric/video/Grec.php?id=33&4.php?file=44
acl nginxs urlpath_regex ^/eric/file/Gfilep\.php         #动态连接拿文件  例如 http://www.nginxs.com/eric/video/Gfilep.php?id=33&4.php?file=45
acl QUERY urlpath_regex cgi-bin \? .php                        # 对其他的url 里有 .php 的不缓存
no_cache allow nginxs
no_cache deny QUERY

refresh_pattern -i ^http://www.nginxs.com/eric/video/Grec.php      1440    50%     10080   override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate
refresh_pattern -i ^http://www.nginxs.com/eric/video/Gfilep.php       1440    50%     10080   override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate
# override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate 是针对返回的 header 使用的违规则~
refresh_pattern -i \.js$        1440    90%     129600  ignore-reload
refresh_pattern -i \.css$       1440    90%     129600  ignore-reload
refresh_pattern -i \.png$       1440    90%     129600  ignore-reload
refresh_pattern -i \.jpg$       1440    90%     129600  ignore-reload
refresh_pattern -i \.jpeg$      1440    90%     129600  ignore-reload
refresh_pattern -i \.gif$       1440    90%     129600  ignore-reload
refresh_pattern -i \.mp3$       1440    90%     129600  ignore-reload
refresh_pattern -i \.bmp$       1440    90%     129600  ignore-reload

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/269.html

分类: squid 标签: , ,
  1. 2017年12月23日01:06 | #1

    payday loans online no credit check
    payday loans no credit
    payday loans no credit check
    payday loans online no credit check
    payday loans online no credit check

  2. 2018年1月1日15:13 | #2

    casino online
    free casino games
    casino online
    online casino
    casino games

  3. 2018年1月2日20:17 | #3

    online gambling sites nfl
    online casino
    best casino online usa

  4. 2018年1月3日12:58 | #4

    payday loans no credit check
    loans no credit check
    loans no credit check
    payday loans
    payday loans no credit

  5. 2018年1月6日14:31 | #5

    I’m gone to inform my little brother, that he should also go to see this web site on regular
    basis to get updated from latest gossip.

  6. 2018年1月11日02:31 | #6

    Unquestionably believe that which you stated.
    Your favorite reason seemed to be on the net the simplest thing to be aware of.
    I say to you, I certainly get irked while people consider worries that they plainly do not know
    about. You managed to hit the nail upon the top and also
    defined out the whole thing without having side effect , people can take a signal.
    Will probably be back to get more. Thanks

  7. 2018年1月12日12:10 | #7

    transfer autocad license
    autocad 2018
    autocad 2012 and autocad lt 2012 bible pdf download

  8. 2018年1月13日16:08 | #8

    Generally I do not read article on blogs, but I wish to say
    that this write-up very pressured me to take a look at and do it!
    Your writing taste has been amazed me. Thank you,
    very great article.

  9. 2018年1月14日10:10 | #9

    payday loans no credit check
    payday loans no credit
    payday loans online no credit check
    loans no credit
    payday loans no credit check

  10. 2018年1月15日16:18 | #10

    If you are going for most excellent contents like me,
    just pay a visit this web page every day as it offers feature contents, thanks

  11. 2018年1月15日16:28 | #11

    Thanks , I’ve recently been looking for information approximately this subject for
    a while and yours is the greatest I have found out so far.
    However, what in regards to the bottom line? Are you sure concerning the source?

  12. 2018年1月18日22:42 | #12

    payday loans no credit check
    payday loans online
    payday loans
    payday loans online
    payday loans no credit check

  13. 2018年1月19日15:10 | #13

    online casino play for free
    real money online
    casinos in michigan with hotels
    download free casino slot games
    us online casinos

评论分页
1 2 3 4 269
订阅评论
1+5= (必填)