squid.conf 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # WELCOME TO SQUID 6.6
  2. # ----------------------------
  3. #
  4. # This is the documentation for the Squid configuration file.
  5. # This documentation can also be found online at:
  6. # http://www.squid-cache.org/Doc/config/
  7. #
  8. # You may wish to look at the Squid home page and wiki for the
  9. # FAQ and other documentation:
  10. # http://www.squid-cache.org/
  11. # https://wiki.squid-cache.org/SquidFaq
  12. # https://wiki.squid-cache.org/ConfigExamples
  13. #
  14. # Example rule allowing access from your local networks.
  15. # Adapt to list your (internal) IP networks from where browsing
  16. # should be allowed
  17. acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
  18. acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
  19. acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
  20. acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
  21. acl localnet src 172.0.0.0/8
  22. acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
  23. acl localnet src fc00::/7 # RFC 4193 local private network range
  24. acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
  25. acl SSL_ports port 443
  26. acl Safe_ports port 80 # http
  27. acl Safe_ports port 81
  28. acl Safe_ports port 443 # https
  29. #
  30. # Recommended minimum Access Permission configuration:
  31. #
  32. # Deny requests to certain unsafe ports
  33. http_access deny !Safe_ports
  34. # Deny CONNECT to other than secure SSL ports
  35. http_access deny CONNECT !SSL_ports
  36. # Only allow cachemgr access from localhost
  37. http_access allow localhost manager
  38. http_access deny manager
  39. # This default configuration only allows localhost requests because a more
  40. # permissive Squid installation could introduce new attack vectors into the
  41. # network by proxying external TCP connections to unprotected services.
  42. http_access allow localhost
  43. # The two deny rules below are unnecessary in this default configuration
  44. # because they are followed by a "deny all" rule. However, they may become
  45. # critically important when you start allowing external requests below them.
  46. # Protect web applications running on the same server as Squid. They often
  47. # assume that only local users can access them at "localhost" ports.
  48. http_access deny to_localhost
  49. # Protect cloud servers that provide local users with sensitive info about
  50. # their server via certain well-known link-local (a.k.a. APIPA) addresses.
  51. http_access deny to_linklocal
  52. #
  53. # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
  54. #
  55. include /etc/squid/conf.d/*.conf
  56. # For example, to allow access from your local networks, you may uncomment the
  57. # following rule (and/or add rules that match your definition of "local"):
  58. # http_access allow localnet
  59. # And finally deny all other access to this proxy
  60. http_access deny all
  61. # Squid normally listens to port 3128
  62. http_port 3128
  63. # Leave coredumps in the first cache dir
  64. coredump_dir /var/spool/squid
  65. #
  66. # Add any of your own refresh_pattern entries above these.
  67. #
  68. refresh_pattern ^ftp: 1440 20% 10080
  69. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  70. refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
  71. refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
  72. refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
  73. refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
  74. # example pattern for deb packages
  75. #refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600
  76. refresh_pattern . 0 20% 4320