Skip to content

Instantly share code, notes, and snippets.

@illicitonion
Created June 19, 2012 22:39
Show Gist options
  • Select an option

  • Save illicitonion/2956943 to your computer and use it in GitHub Desktop.

Select an option

Save illicitonion/2956943 to your computer and use it in GitHub Desktop.
squid config
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# TODO(santiycr): Set up localnet ACLs
acl localnet src 10.0.0.0/8
acl localnet src 172.16.0.0/12
acl localnet src 192.168.0.0/16
acl localnet src fc00::/7
acl localnet src fe80::/10
acl Safe_ports port 80
# For magical testing
#acl Safe_ports port 9998
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow localnet
http_access allow localhost
http_access deny all
cache allow localnet
cache allow localhost
cache deny all
cache_mem 500 MB
# Squid normally listens to port 3128
# To test locally:
#http_port 127.0.0.1:3128
http_port 3128
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /usr/local/squid/var/cache 100 16 256
refresh_pattern .jar$ 1440 100% 1440
refresh_pattern . 0 0% 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment