# created by SAMS _sams_ 2012-10-11 11:59:49
# TAG: http_port
http_port 172.16.1.100:3128
visible_hostname 172.16.1.100
# dns_nameservers 127.0.0.1 8.8.8.8 8.8.4.4
# Здесь нужно указать ДНС-серверы вашего провайдера (через пробел).
hierarchy_stoplist cgi-bin ?
# squid не будет кешировать динамически генерируемые страницы (поисковые сервера, некоторые другие серверы и чаты),
# а будет напрямую перенаправлять запрос серверу
coredump_dir /var/spool/squid
# Указываем куда сбрасывать core
# TAG: cache_mem (bytes)
cache_mem 1024 MB
# сколько оперативной памяти сквид может забрать под свои нужды.
maximum_object_size 2000 KB
# максимальный размер объектов, которые будут сохранены на диск.
maximum_object_size_in_memory 1000 KB
# максимальный размер объектов, которые будут сохранены в кэше.
# TAG: cache_dir
cache_dir ufs /var/spool/squid 4096 16 256
# указывает сквиду, где сохранять кешируемые файлы. Указывает отдать под кеш 4096 мегабайт и
# создать 16 и 256 соответственно каталогов 1го и 2го уровня.
# TAG: cache_access_log
# TAG: cache_log
# TAG: cache_store_log
# TAG: ftp_user
# в этих строках мы указываем сколько времени в минутах объект в кеше считается свежим
# и какой процент объектов оставлять с последнего обновления
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
# TAG: redirect_program
# redirect_program /etc/squid/redirector.sams
# Позже, здесь можно будет указать путь к редиректору.
# TAG: redirector_access
# TAG: auth_param
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of="ATG-U\\Пользователи домена"
auth_param ntlm children 100
auth_param ntlm keep_alive on
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic --require-membership-of="ATG-U\\Пользователи домена"
auth_param basic children 100
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
# TAG: acl
acl _sams_505aa18873aed proxy_auth "/etc/squid/505aa18873aed.sams"
acl _sams_505aa18873aed_time time MTWHFAS 00:00-23:59
acl _sams_505aa15012b0d proxy_auth "/etc/squid/505aa15012b0d.sams"
acl _sams_505aa15012b0d_time time MTWHFAS 00:00-23:59
acl _sams_505aa0a793b3e url_regex -i "/etc/squid/505aa0a793b3e.sams"
acl _sams_chat url_regex -i "/etc/squid/chat.sams"
acl _sams_porno url_regex -i "/etc/squid/porno.sams"
acl manager proto cache_object
# назначить протоколу кеширования объектов название manager
acl localhost src 127.0.0.1/32 172.16.1.100/32
# адрес сервера
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
# удалённые адреса
acl localnet src 172.16.0.0/23
# адресное пространство локальной сети
acl SSL_ports port 443
acl Safe_ports port "/etc/squid/allowports.txt"
# разрешённые порты
acl CONNECT method CONNECT
# для джаваскриптов и загрузки файлов
acl fileupload req_mime_type -i ^multipart/form-data$
acl javascript rep_mime_type -i ^application/x-javascript$
# список проблемных сайтов типа hh.ru
acl problem_sites url_regex -i "/etc/squid/problem-sites.txt"
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
# Запрет всех портов, кроме разрешённых
http_access deny CONNECT !SSL_ports
# Запрет всех SSL портов, кроме разрешённых
http_access deny to_localhost
# разрешить джаваскрипты и загрузку файлов
http_access allow fileupload
http_access allow javascript
# для доступа к проблемным сайтам
request_header_access Allow allow problem_sites
request_header_access Authorization allow problem_sites
request_header_access WWW-Authenticate allow problem_sites
request_header_access Proxy-Authorization allow problem_sites
request_header_access Proxy-Authenticate allow problem_sites
request_header_access Cache-Control allow problem_sites
request_header_access Content-Encoding allow problem_sites
request_header_access Content-Length allow problem_sites
request_header_access Content-Type allow problem_sites
request_header_access Date allow problem_sites
request_header_access Expires allow problem_sites
request_header_access Host allow problem_sites
request_header_access If-Modified-Since allow problem_sites
request_header_access Last-Modified allow problem_sites
request_header_access Location allow problem_sites
request_header_access Pragma allow problem_sites
request_header_access Accept allow problem_sites
request_header_access Accept-Charset allow problem_sites
request_header_access Accept-Encoding allow problem_sites
request_header_access Accept-Language allow problem_sites
request_header_access Content-Language allow problem_sites
request_header_access Mime-Version allow problem_sites
request_header_access Retry-After allow problem_sites
request_header_access Title allow problem_sites
request_header_access Connection allow problem_sites
request_header_access Proxy-Connection allow problem_sites
# request_header_access User-Agent allow problem_sites
request_header_access Set-Cookie allow problem_sites
request_header_access Cookie allow problem_sites
request_header_access All deny problem_sites
# TAG: http_access
http_access allow _sams_505aa18873aed !_sams_505aa0a793b3e !_sams_chat !_sams_porno _sams_505aa18873aed_time
http_access allow _sams_505aa15012b0d _sams_505aa15012b0d_time
http_access allow localhost
# разрешить доступ с сервера
http_access deny all
# запретить всё остальное
# TAG: delay_pools
icap_enable on
# включить icap
icap_preview_enable on
icap_preview_size 128
icap_send_client_ip on
icap_service service_req reqmod_precache bypass=1 icap://127.0.0.1:1344/srv_clamav
icap_service service_resp respmod_precache bypass=0 icap://127.0.0.1:1344/srv_clamav
adaptation_access service_req allow all
adaptation_access service_resp allow all
# всех проверяем на вирусы