willianholtz

squid.conf

Aug 30th, 2013
194
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cache_mem 512 MB
  2. maximum_object_size_in_memory 64 MB
  3. maximum_object_size 1024 MB
  4. minimum_object_size 0
  5. cache_swap_low 90
  6. cache_swap_high 95
  7. cache_dir ufs /home/temp/cache/squid 18000 8 64
  8. cache_access_log /var/log/squid/acesso.log
  9. cache_dir ufs /var/cache/squid 2048 8 16
  10.  
  11. ##CONFIGURACAO BASICA DO SQUID
  12.  
  13. acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
  14. acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
  15. acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
  16. acl localnet src fc00::/7 # RFC 4193 local private network range
  17. acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
  18.  
  19. acl SSL_ports port 443 # https
  20. acl Safe_ports port 80 # http
  21. acl Safe_ports port 21 # ftp
  22. acl Safe_ports port 443 # https
  23. acl Safe_ports port 70 # gopher
  24. acl Safe_ports port 210 # wais
  25. acl Safe_ports port 1025-65535 # unregistered ports
  26. acl Safe_ports port 280 # http-mgmt
  27. acl Safe_ports port 488 # gss-http
  28. acl Safe_ports port 591 # filemaker
  29. acl Safe_ports port 777 # multiling http
  30. acl CONNECT method CONNECT
  31.  
  32. # Deny requests to certain unsafe portshttp_access deny !Safe_ports
  33. # Deny CONNECT to other than secure SSL ports
  34. #http_access deny CONNECT !SSL_ports
  35. #http_access deny to_localhost
  36.  
  37. # DEFAULT CONFIGURATIONS
  38. coredump_dir /var/cache/squid
  39. #refresh_pattern ^ftp: 15 20% 2280
  40. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  41. #refresh_pattern . 15 20% 2280
  42.  
  43. #Criando regras para cache de videos
  44. acl googlevideo dstdomain .googlevideo.com
  45. cache allow googlevideo
  46. acl youtube dstdomain .youtube.com
  47. cache allow youtube
  48. acl facebook dstdomain .facebook.com
  49. cache allow facebook
  50.  
  51. # Windows Update refresh_pattern
  52. range_offset_limit -1
  53. refresh_pattern -i microsoft.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  54. refresh_pattern -i windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  55. refresh_pattern -i my.windowsupdate.website.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  56. # Windows Update end
  57.  
  58.  
  59. ##ADICIONANDO AS REGRAS
  60. acl download url_regex -i "/home/temp/sites/downloads"
  61. acl squid_porn dstdomain "/home/temp/sites/squid-porn.acl"
  62. acl squid_malicious dstdomain "/home/temp/sites/squid-malicious.acl"
  63. acl squid_ads dstdomain "/home/temp/sites/squid-ads.acl"
  64.  
  65. ##BLOQUEANDO AS REGRAS
  66. http_access deny squid_porn
  67. http_access deny squid_malicious
  68. http_access deny squid_ads
  69. http_access deny download
  70.  
  71. #Cache de video
  72. refresh_pattern -i \.flv$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
  73.  
  74. acl youtube dstdomain .youtube.com
  75. #cache allow youtube
  76. #quick_abort_min 512 KB
  77.  
  78. #memory_pools off
  79.  
  80. ##PERMISSÃO DE ACESSO AS REGRAS
  81. http_port 3128 transparent
  82. http_access allow localhost manager
  83. http_access allow localnet
  84. http_access allow localhost
  85. http_access allow all
RAW Paste Data