# Configuration reference: # http://www.squid-cache.org/Versions/v3/3.2/cfgman/ # https://calomel.org/squid.html # Note to self search for "TODO" and "TEST" # Bind to the standard squid part (3128) http_port [::]:3128 ### GENERAL CONFIGURATION # Email address of the local cache manager in case an issue crops up. This will # also show up in error messages. cache_mgr cache-admin@proxy-01.i.0x378.net # For security and stability reasons Squid can check hostnames for Internet # standard RFC compliance. check_hostnames on # Leave coredumps in the base cache directory coredump_dir /var/spool/squid # Automatically close broken persistent connections detect_broken_pconn on # Using the transparent option prevent squid from manipulating this header, # turning it off just sets the client's address do "unknown". forwarded_for transparent # Prevent Squid from announcing it's version information httpd_suppress_version_string on # Minimum umask to be enforced for all written files, generally this should be # public information (cached content) but it can't hurt to restrict it. umask 027 # Hostname that is visible in error messages, and if used in a cluster used to # detect forwarding loops. If your cluster needs to use the same # visible_hostname investigate the related option unique_hostname. visible_hostname proxy-01.internal.private.web ### TIMEOUTS # How long to wait for TCP connect to a requested server or peer to complete # before Squid should attempt to find another path to forward the request. connect_timeout 5 second # If no response is received to a DNS query within this time all DNS servers # for the queried domain are assumed to be unavailable. This may cause # transient resolution errors to be cached but I haven't verified that. dns_timeout 5 second # Max length of time Squid should attempt to find a forwarding path for a # request before giving up. forward_timeout 10 second # How long to wait for complete HTTP request headers after initial connection # establishment. request_timeout 10 second ### AUTHENTICATION # Ensure usernames are case sensitive auth_param basic casesensitive on # Length of time to consider credentials authenticated through the external # program valid. auth_param basic credentialsttl 2 hours # Use basic htpasswd style files to handle authentication. auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/accounts # The realm to display to any inquistive clients auth_param basic realm Proxy Access Requires Authentication ### CACHE CONFIGURATION # <# of first level # directories> <# of second level directories> aufs is the non-blocking disk # storage option cache_dir aufs /var/spool/squid 1024 16 256 # This represents the maximum amount of ram that squid will utilize to keep # cached objects in memory. Squid requires about 100Mb of RAM per Gb of cache # storage. If you have a 10gb cache, Squid will use ~1Gb just to handle that. # Make sure that cache_mem + (cache_dir size limit * 100Mb) is less than your # available RAM. cache_mem 192 MB # Least Frequently Used with Dynamic Aging (keeps popular objects in cache # regardless of their size and thus optimizes byte hit rate at the expense of # hit rate since one large, popular object will prevent many smaller, slightly # less popular objects from being cached. cache_replacement_policy heap LFUDA # Limit the size of file to hold in the cache, 10 MB is about the largest file # I expect multiple of my client to pull down. maximum_object_size 10 MB # Tell squid to release memory it's not using memory_pools off # Cacheing rules for content that doesn't have an explicit expire time. refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 # Specifies how long squid should wait when it's service is asked to stop. # Generally this to allow client requests to complete, but I find it more # useful to make this fast. shutdown_lifetime 1 second # This normally evaluate how much data is left in a transfer when a client # disconnects before it's completed, and if the remaining data falls in the # configured range, Squid will finish downloading the file and cache it anyway. # This is cool but not useful in my environment. quick_abort_min 0 KB quick_abort_max 0 KB ### SSL BUMP # TODO: This is exactly worst practices in most cases, however, for a highly # restricted network of servers using this as their only means of accessing the # internet... It can be an important security measure. ### CUSTOM ERROR MESSAGES # TODO: Useful for client facing servers ### SQUIDGUARD CONFIG #url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf #url_rewrite_bypass off ### LOGGING # [] " # HTTP/ : logformat combined %>a %un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh # [] "" "" logformat debugheaders %>a %un [%tl] "%>h" "%