当前位置: 首页 > 工具软件 > Squid > 使用案例 >

squid 的一些代码

濮书
2023-12-01
# NETWORK OPTIONS
# -----------------------------------------------------------------------------


http_port 80 accel vhost vport


# -----------------------------------------------------------------------------


cache_peer 103.240.202.59 parent 80 0 no-query originserver weight=1 name=server
cache_peer_domain server .baidu.com .163.com 

cache_peer 103.240.202.59 parent 80 0 no-query originserver weight=1 name=server1
cache_peer_domain server1 .ceshiwang.com 



# 例子开始-----------------------------------------------------------------------
# cache_peer 127.0.0.1 parent 80 0 no-query originserver weight=1 name=server    127.0.0.1为数据服务器的IP name=server 数据服务器的名字
# cache_peer_domain server .yuming.com                         server这里的和上面的数据服务器名字统一 多个就变换名字即可 .yuming.com 这里填写域名


# cache_peer 127.0.0.3 parent 80 0 no-query originserver weight=1 name=server2
# cache_peer_domain server2 .yuming2.com


# 例子结束-----------------------------------------------------------------------


# -----------------------------------------------------------------------------


hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
collapsed_forwarding on


# -----------------------------------------------------------------------------


cache_mem 1024 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 1024 KB
minimum_object_size 50 KB


# -----------------------------------------------------------------------------


cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF


# -----------------------------------------------------------------------------


cache_dir aufs C:/Squid/var/cache 20000 16 256
#access_log C:/Squid/var/logs/access.log squid
#cache_log C:/Squid/var/logs/cache.log
#cache_store_log C:/Squid/var/logs/store.log


# -----------------------------------------------------------------------------


refresh_pattern ^proxy: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440 
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320


range_offset_limit 0 KB
quick_abort_min 0 KB
quick_abort_max 0 KB


# -----------------------------------------------------------------------------


request_entities off
coredump_dir C:/Squid/var/cache
cache_mgr web@znncnn.com
via off
httpd_suppress_version_string off
visible_hostname Znncnn.com


# -----------------------------------------------------------------------------


acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8


acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network


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
acl purge method PURGE


http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow all
http_access deny all
http_access allow purge localhost
http_access deny purge
icp_access allow localnet
icp_access deny all

 类似资料: