pfsense:squid:setup_completely2
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
pfsense:squid:setup_completely2 [2020/03/15 13:24] – created peter | pfsense:squid:setup_completely2 [2021/01/06 11:54] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PFSense - Squid - Setup completely2 ====== | ||
- | |||
- | < | ||
- | # SQUID 2.7 CONFIG FILE | ||
- | # By - Syed Jahanzaib | ||
- | # Email: aacable@hotmail.com | ||
- | # Web : https:// | ||
- | |||
- | # PORT and Transparent Option | ||
- | http_port 8080 transparent | ||
- | server_http11 on | ||
- | icp_port 0 | ||
- | |||
- | # Cache Directory , modify it according to your system. | ||
- | # but first create directory in root by | ||
- | # mkdir /cache1 | ||
- | # chown proxy:proxy /cache1 | ||
- | # [for ubuntu user is proxy, in Fedora user is SQUID] | ||
- | # I have set 100 GB for caching, Adjust it according to your need. | ||
- | # My recommendation is to have one cache_dir per drive. zzz | ||
- | |||
- | store_dir_select_algorithm round-robin | ||
- | cache_dir aufs /cache1 100000 16 256 | ||
- | #cache_dir ufs / | ||
- | memory_replacement_policy heap GDSF | ||
- | cache_replacement_policy heap GDSF | ||
- | |||
- | # If you want to enable DATE time n SQUID Logs,use following | ||
- | emulate_httpd_log on | ||
- | logformat squid %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt | ||
- | log_fqdn off | ||
- | |||
- | # How much days to keep users access web logs | ||
- | # You need to rotate your log files with a cron job. For example: | ||
- | # 0 0 * * * / | ||
- | logfile_rotate 14 | ||
- | debug_options ALL,1 | ||
- | cache_access_log / | ||
- | cache_log none | ||
- | cache_store_log none | ||
- | |||
- | # Block Ads [zaib] | ||
- | #acl adsites dstdomain url_regex "/ | ||
- | # | ||
- | #deny_info http:// | ||
- | |||
- | #I used DNSAMSQ service for fast dns resolving | ||
- | #so install by using " | ||
- | dns_nameservers 127.0.0.1 8.8.8.8 | ||
- | ftp_user anonymous@ | ||
- | ftp_list_width 32 | ||
- | ftp_passive on | ||
- | ftp_sanitycheck on | ||
- | |||
- | #ACL Section mylan myacl | ||
- | acl all src 0.0.0.0/ | ||
- | #acl all src 192.168.50.0/ | ||
- | #acl all2 src 10.0.0.0/ | ||
- | acl manager proto cache_object | ||
- | acl localhost src 127.0.0.1/ | ||
- | acl to_localhost dst 127.0.0.0/8 | ||
- | acl SSL_ports port 443 563 # https, snews | ||
- | acl SSL_ports port 873 # rsync | ||
- | acl Safe_ports port 80 # http | ||
- | acl Safe_ports port 21 # ftp | ||
- | acl Safe_ports port 443 563 # https, snews | ||
- | 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 Safe_ports port 631 # cups | ||
- | acl Safe_ports port 873 # rsync | ||
- | acl Safe_ports port 901 # SWAT | ||
- | acl purge method PURGE | ||
- | acl CONNECT method CONNECT | ||
- | http_access allow manager all | ||
- | http_access deny manager | ||
- | http_access allow purge localhost | ||
- | http_access deny purge | ||
- | http_access deny !Safe_ports | ||
- | http_access deny CONNECT !SSL_ports | ||
- | http_access allow localhost | ||
- | http_access allow all | ||
- | # | ||
- | http_reply_access allow all | ||
- | # | ||
- | icp_access allow all | ||
- | |||
- | # | ||
- | # Administrative Parameters | ||
- | # | ||
- | |||
- | # | ||
- | # SNMP , if you want to generate graphs for SQUID via MRTG | ||
- | # | ||
- | #acl snmppublic snmp_community zaib | ||
- | #snmp_port 3401 | ||
- | # | ||
- | # | ||
- | |||
- | # I used UBUNTU so user is proxy, in FEDORA you may use use squid | ||
- | cache_effective_user proxy | ||
- | cache_effective_group proxy | ||
- | cache_mgr SYED_JAHANZAIB | ||
- | visible_hostname aacable.wordpress.com | ||
- | unique_hostname aacable@hotmail.com | ||
- | |||
- | # Memory | ||
- | cache_mem 128 MB | ||
- | minimum_object_size 0 bytes | ||
- | maximum_object_size 700 MB | ||
- | maximum_object_size_in_memory 32 KB | ||
- | |||
- | tcp_outgoing_tos 0x30 all | ||
- | zph_mode tos | ||
- | zph_local 0x30 | ||
- | zph_parent 0 | ||
- | zph_option 136 | ||
- | |||
- | acl store_rewrite_list urlpath_regex | ||
- | acl store_rewrite_list urlpath_regex | ||
- | acl store_rewrite_list_domain url_regex | ||
- | acl store_rewrite_list_domain url_regex | ||
- | acl store_rewrite_list_path urlpath_regex | ||
- | acl store_rewrite_list_domain_CDN url_regex | ||
- | acl store_rewrite_list_domain_CDN url_regex | ||
- | acl store_rewrite_list_domain_CDN url_regex | ||
- | acl store_rewrite_list_domain_CDN url_regex | ||
- | acl dontrewrite url_regex redbot\.org \.php | ||
- | acl getmethod method GET | ||
- | |||
- | storeurl_access deny dontrewrite | ||
- | storeurl_access deny !getmethod | ||
- | storeurl_access allow store_rewrite_list_domain_CDN | ||
- | storeurl_access allow store_rewrite_list | ||
- | storeurl_access allow store_rewrite_list_domain | ||
- | storeurl_access allow store_rewrite_list_path | ||
- | storeurl_access deny all | ||
- | # First add storeurl.pl to enable below, see my other guides | ||
- | # e.g: https:// | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | ## | ||
- | refresh_pattern -i \.htm 120 50% 10080 reload-into-ims | ||
- | refresh_pattern -i \.html 120 50% 10080 reload-into-ims | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ^http:// | ||
- | ## | ||
- | |||
- | # 1 year = 525600 mins, 1 month = 43800 mins | ||
- | refresh_pattern imeem.*\.flv | ||
- | refresh_pattern \.rapidshare.*\/ | ||
- | |||
- | refresh_pattern (get_video\? | ||
- | refresh_pattern (get_video\? | ||
- | # | ||
- | refresh_pattern \.(ico|video-stats) 10800 80% 10800 override-expire ignore-reload ignore-no-cache | ||
- | refresh_pattern \.etology\? | ||
- | refresh_pattern galleries\.video(\? | ||
- | refresh_pattern brazzers\? | ||
- | refresh_pattern \.adtology\? | ||
- | refresh_pattern ^.*(utm\.gif|ads\? | ||
- | refresh_pattern ^.*safebrowsing.*google | ||
- | refresh_pattern ^http:// | ||
- | refresh_pattern ytimg\.com.*\.jpg | ||
- | refresh_pattern images\.friendster\.com.*\.(png|gif) | ||
- | refresh_pattern garena\.com | ||
- | refresh_pattern photobucket.*\.(jp(e? | ||
- | refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? | ||
- | refresh_pattern mediafire.com\/ | ||
- | refresh_pattern ^http: | ||
- | refresh_pattern ^http: | ||
- | |||
- | # ANTI VIRUS | ||
- | refresh_pattern guru.avg.com/ | ||
- | refresh_pattern (avgate|avira).*(idx|gz)$ | ||
- | refresh_pattern kaspersky.*\.avc$ | ||
- | refresh_pattern kaspersky | ||
- | refresh_pattern update.nai.com/ | ||
- | refresh_pattern ^http: | ||
- | |||
- | refresh_pattern windowsupdate.com/ | ||
- | refresh_pattern update.microsoft.com/ | ||
- | refresh_pattern download.microsoft.com/ | ||
- | |||
- | #images facebook | ||
- | refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(jpg|png|gif) | ||
- | refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3) | ||
- | refresh_pattern | ||
- | refresh_pattern ^http: | ||
- | |||
- | #banner IIX | ||
- | refresh_pattern ^http: | ||
- | refresh_pattern ^http: | ||
- | refresh_pattern ^http: | ||
- | refresh_pattern .kompasimages.com.*\.(jpg|gif|png|swf) | ||
- | refresh_pattern ^http: | ||
- | refresh_pattern kaskus.\us.*\.(jp(e? | ||
- | refresh_pattern ^http: | ||
- | |||
- | #IIX DOWNLOAD | ||
- | refresh_pattern ^http: | ||
- | |||
- | #All File | ||
- | refresh_pattern -i \.(3gp|7z|ace|asx|avi|bin|cab|dat|deb|divx|dvr-ms) | ||
- | refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)) | ||
- | refresh_pattern -i \.(jp(e? | ||
- | refresh_pattern -i \.(mp(e? | ||
- | refresh_pattern -i \.(pp(s|t)|wax|wm(a|v)|wmx|wpl|zip|cb(r|z|t)) | ||
- | |||
- | refresh_pattern (cgi-bin|\? | ||
- | refresh_pattern ^gopher: | ||
- | refresh_pattern ^ftp: | ||
- | refresh_pattern | ||
- | |||
- | global_internal_static off | ||
- | max_stale 10 years | ||
- | retry_on_error on | ||
- | buffered_logs on | ||
- | read_ahead_gap 32 KB | ||
- | |||
- | # | ||
- | client_persistent_connections off | ||
- | server_persistent_connections on | ||
- | half_closed_clients off | ||
- | strip_query_terms off | ||
- | quick_abort_min 0 KB | ||
- | quick_abort_max 0 KB | ||
- | quick_abort_pct 100 | ||
- | vary_ignore_expire on | ||
- | reload_into_ims on | ||
- | pipeline_prefetch on | ||
- | read_timeout 30 minutes | ||
- | client_lifetime 6 hours | ||
- | $negative_ttl 30 seconds | ||
- | positive_dns_ttl 6 hours | ||
- | $negative_dns_ttl 60 seconds | ||
- | pconn_timeout 15 seconds | ||
- | request_timeout 1 minute | ||
- | $store_avg_object_size 13 KB | ||
- | log_icp_queries off | ||
- | ipcache_size 16384 | ||
- | ipcache_low 98 | ||
- | ipcache_high 99 | ||
- | log_fqdn off | ||
- | fqdncache_size 16384 | ||
- | memory_pools off | ||
- | forwarded_for on | ||
- | client_db off | ||
- | max_filedescriptors 8192 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== References ===== | ||
- | |||
- | https:// | ||
pfsense/squid/setup_completely2.1584278694.txt.gz · Last modified: 2020/07/15 09:30 (external edit)