# squid.conf - "squid" cache configuration file
# License:  Same as for "squid"
# Revision: 110918

# This is a safety measure:
#
memory_pools_limit 64 MB

# This disables caching for web servers running on the local system.
#
acl dontcache dstdomain 127.0.0.1
no_cache deny dontcache

# If you'd like to divert requests for a specific domain to a specific
# proxy server, uncomment the "cache_peer" block below  and  modify it
# as follows:
#
#     Replace 127.0.0.1         with hostname or IP address of proxy
#     Replace 53000             with proxy port number
#     Replace nosuchdomain.com  with domain to be diverted
#
# Note that in  the "cache_peer_domain" line,  a period should be pre-
# pended to the domain.

cache_peer 127.0.0.1 parent 53000 0 no-query no-digest name=sylvester
cache_peer_domain sylvester .nosuchdomain.com
acl tweety dstdomain nosuchdomain.com
never_direct allow tweety

# Needed for squidclient "mgr:" operations to work correctly:
#
cachemgr_passwd none offline_toggle

url_rewrite_program  __META_PREFIX__/etc/squid-rewrite-localtree
url_rewrite_children 30

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

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed

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

# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect
# innocent web applications running on the proxy server who think
# the only one who can access services on "localhost" is a local
# user
#
# http_access deny to_localhost

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

acl blocksites url_regex -i "__META_PREFIX__/etc/squid-block.acl"
http_access deny blocksites
acl SedoParking dst 82.98.86.0/24
http_access deny SedoParking

acl purge method PURGE
acl src_local src 127.0.0.0/8
http_access allow purge src_local
http_access deny  purge

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed

http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend that you use at least the following line.
#
hierarchy_stoplist cgi-bin ?

#---------------------------------------------------------------------

# To use a disk cache, uncomment the  "cache_dir"  and  "coredump_dir"
# settings and  change the specified directory path as desired.  Addi-
# tionally, create the specified  directory and "chmod" it to 777  or,
# alternately, "chown" it to nobody.nogroup and "chmod" it to 770. The
# second approach is more secure.  Finally,  change the number  before
# "256 256" here to the desired maximum disk-cache size,  expressed in
# megabytes. If the disk cache directory is located in a RAM disk, the
# number should be small (possibly 15).  Otherwise,  use 100 to 100000
# or above  (depending on the free space in the associated disk parti-
# tion).

# To use a memory cache only (without a disk cache),  comment-out  the
# "cache_dir" and "coredump_dir" settings.

cache_dir aufs /var/tmp/squidcache 500 256 256
coredump_dir   /var/tmp/squidcache

#---------------------------------------------------------------------

# Add any of your own refresh_pattern entries above these.

# For  a normal  configuration,  uncomment the first block of settings
# that follows and comment-out the second block.

# If you're trying to  mirror a large  site,  or a large set of sites,
# using "httrack" (or a similar program) in  conjunction with "squid",
# you may need to  proceed differently  while you're building the mir-
# ror.

# Specifically,  you may  need to comment-out the first block and  un-
# comment the second block  except  for  the  "*ttl*" settings,  which
# should  be commented out  in this  case.  Warning:  The second block
# isn't suitable for normal use.  Be sure to switch back when the mir-
# ror is completed.

# If you're trying to build a  "squid"  cache tree  that  will be used
# permanently in "offline" mode,  the  following approach may  (or may
# not) be useful: While the tree is under construction, use the second
# block of settings,  except for the  "negative*_ttl" settings  (which
# should be commented  out). When the tree is completed, uncomment the
# "negative_*ttl" settings as well and  run all downloads again  (they
# should be  picked up mostly from the  cache). When you use  the tree
# afterward, run with the same settings;  i.e., with the entire second
# block uncommented.

# Important:  If the  "squid" daemon is running  when you comment-out,
# uncomment,  or modify settings,  remember  to  execute the following
# command after changes are saved:
#
#     squid -k reconfigure

refresh_pattern ^ftp:             1440    20%    10080
refresh_pattern ^gopher:          1440     0%     1440
refresh_pattern -i (/cgi-bin/|\?)    0     0%        0
refresh_pattern .                    0    20%     4320
positive_dns_ttl 6 hours
negative_dns_ttl 1 minutes
negative_ttl 0 seconds
maximum_object_size 4 MB
offline_mode off

# refresh_pattern ^ftp:             100000 90% 100000 override-expire override-lastmod ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate ignore-private ignore-auth
# refresh_pattern ^gopher:          100000 90% 100000 override-expire override-lastmod ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate ignore-private ignore-auth
# refresh_pattern -i (/cgi-bin/|\?) 100000 90% 100000 override-expire override-lastmod ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate ignore-private ignore-auth
# refresh_pattern .                 100000 90% 100000 override-expire override-lastmod ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate ignore-private ignore-auth
# positive_dns_ttl 1000000 hours
# negative_dns_ttl 900000 hours
# negative_ttl 1000000 hours
# maximum_object_size 256 MB
# offline_mode on

#---------------------------------------------------------------------

# For  a safe setup  that should  work with most systems,  "cache_mem"
# should be set to: 32 MB

# For systems with a large amount of RAM, "cache_mem" should be set to
# a larger value, possibly 64 MB or 128 MB.

cache_mem 32 MB
