pmesquita
(usa Debian)
Enviado em 03/06/2014 - 10:39h
http_port 192.168.10.1:3128
#http_port 172.16.16.1:3128
htcp_port 0
pid_filename /var/run/squid3.pid
logfile_rotate 0
forwarded_for off
memory_pools off
half_closed_clients off
# >>> Diretivas de Cache em disco <<< #
cache_mem 256 MB
cache_swap_low 50
cache_swap_high 70
ipcache_size 2048
ipcache_low 70
ipcache_high 90
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
coredump_dir /mnt/sda6
cache_effective_user proxy
cache_effective_group proxy
cache_dir aufs /mnt/sda6/1 4000 50 75
cache_dir aufs /mnt/sda6/2 4000 50 75
cache_dir aufs /mnt/sda6/3 4000 50 75
cache_dir aufs /mnt/sda6/4 4000 50 75
cache_dir aufs /mnt/sda6/5 4000 50 75
# Resolve um problema com conexoes persistentes
detect_broken_pconn on
# Provoca um ganho de performance ao usar conexoes Pipeline (requisicoes em paralelo)
pipeline_prefetch on
# >> Padrao de atualizacao do cache <<
refresh_pattern ^ftp: 120 20% 2280
refresh_pattern ^gopher: 120 0% 2280
refresh_pattern . 120 20% 2280
refresh_pattern -i \.(gif|png|jpg|jpeg|ico|bmp|tif)$ 0 90% 260009 override-expire
refresh_pattern -i \.(avi|mpeg|swf|flv|x-flv|mpg|wma|wmv|asx|asf)$ 0 90% 999999 override-expire
refresh_pattern -i \.(wav|mp3|mp4|ogg|wmv)$ 0 90% 260009 override-expire
refresh_pattern -i \.(deb|rpm|dll|msi|exe)$ 0 90% 260009 override-expire
refresh_pattern -i \.(rar|zip|7z|tar|gz|cab|vdf|deb)$ 0 90% 260009 override-expire
refresh_pattern -i \.(doc|docx|xls|xlsx|ppt|pptx|pps|ppsx|rtf|docx|xls|xlsx|ppt|pptx|pps|ppsx|rtf|pdf)$ 0 90% 260009 override-expire
refresh_pattern -i \.(html|htm|css|js|php|swf|xml)$ 0 90% 40320
# Indica ao Squid que ele deve buscar os dados diretamente na origem, sem passar pelos outros servidores de Proxy
hierarchy_stoplist cgi-bin ?
# Indica ao squid para nao armazenar em cache o conteudoo dos CGI's
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# O tamanho maximo dos arquivos que serao guardados no cache RAM.
maximum_object_size_in_memory 15 MB
# Tamanho maximo e minimo para arquivos serem baixados e armazenados no cache o maximo sao downloads de 10MB e o minimo 1KB
# Se uma porcentagem maior do que a configurada em quick_abort_pct tiver sido baixada, ele finaliza o download
maximum_object_size 10240 KB
minimum_object_size 1 KB
quick_abort_pct 95
# Localizacao do logs de acesso
access_log /var/log/squid3/access.log
cache_log /var/log/squid3/cache.log
cache_store_log /var/log/squid3/store.log
# Visualiza TODO o link acessado
strip_query_terms off
# Define os servidores DNS
dns_nameservers 127.0.0.1
# ***** Define as ACLs ***** #
acl RedeLocal src 192.168.10.0/24
acl RedeWifi src 172.16.16.0/23
acl localhost src 127.0.0.1/32
acl to_localhost dst 192.168.0.0/24 172.16.16.0/23
acl SSL_ports port 443 # SSL
acl Safe_ports port 80 # HTTP
acl Safe_ports port 443 # HTTPS
acl Safe_ports port 34567 # SKYPE
acl purge method PURGE
acl CONNECT method CONNECT
acl WordWifiBlock urlpath_regex -i "/etc/squid3/arquivos/WordWifiBlock.txt"
## ***** Aplicacao das Regras ***** #
cache allow RedeLocal
cache allow RedeWifi
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow !WordWifiBlock