CENTOS7.4 squid网关代理设置

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 localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
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 allow localhost manager
http_access deny manager
http_access allow localnet
http_access allow localhost
http_port 3128 transparent
cache_dir ufs /home/cache 1024 16 256
coredump_dir /var/spool/squid
refresh_pattern -i .css$ 3600 90% 48800 reload-into-ims
refresh_pattern -i .js$ 1440 90% 28800 reload-into-ims
refresh_pattern -i .html$ 1440 90% 14400 reload-into-ims
refresh_pattern -i .jpg$ 1440 90% 28800 ignore-reload
refresh_pattern -i .gif$ 1440 90% 28800 ignore-reload
refresh_pattern -i .swf$ 1440 90% 28800 ignore-reload
refresh_pattern -i .jpg$ 1440 90% 28800 ignore-reload
refresh_pattern -i .png$ 1440 90% 28800 ignore-reload
refresh_pattern -i .bmp$ 1440 90% 28800 ignore-reload
refresh_pattern -i .doc$ 1440 90% 28800 ignore-reload
refresh_pattern -i .ppt$ 1440 90% 28800 ignore-reload
refresh_pattern -i .xls$ 1440 90% 28800 ignore-reload
refresh_pattern -i .pdf$ 1440 90% 28800 ignore-reload
refresh_pattern -i .rar$ 1440 90% 28800 ignore-reload
refresh_pattern -i .zip$ 1440 90% 28800 ignore-reload
refresh_pattern -i .txt$ 1440 90% 28800 ignore-reload
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 14400
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 14400 90% 4880
cache_mem 1024 MB #设置squid可以使用的内存大小
cache_swap_low 90 #缓存内部对象的替换的衡量基线
cache_swap_high 95 #缓存内部对象替换的最高程度
maximum_object_size 32768 KB #设置squid磁盘缓存最大文件
maximum_object_size_in_memory 1024 KB #设置squid内存缓存最大文件
cache_replacement_policy lru #设置squid磁盘替换策略:最少近来使用(LRU),贪婪对偶大小次数(GDSF),和动态衰老最少经常使用(LFUDA)
memory_replacement_policy lru #设置squid内存替换策略:最少近来使用(LRU),贪婪对偶大小次数(GDSF),和动态衰老最少经常使用(LFUDA)
acl QUERY urlpath_regex -i cgi-bin \? \.asp \.php \.jsp \.cgi
acl denyssl urlpath_regex -i ^https:\\
access_log /home/cache/access.log squid
cache_log /home/cache/cache.log
cache_store_log /home/cache/store.log
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
dns_nameservers 180.76.76.76 8.8.8.8
cache_effective_user squid squid
acl allow_lan src 10.12.77.0/24
#acl badurl url_regex “/usr/local/squid/sexurl.txt”
acl all src all
http_access allow allow_lan
http_access allow all
visible_hostname siyuan