Конфиг
# порт на котором доступен прокси
http_port 3128
workers 3
#dns_nameservers 8.8.8.8 1.1.1.1
visible_hostname squidserv
dns_nameservers 208.67.222.222 208.67.220.220 127.0.0.1
# авторизация, по паролю
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5 startup=5 idle=1
auth_param basic realm Welcome to Proxy
auth_param basic credentialsttl 2 hours
acl Users proxy_auth REQUIRED
# пускать товарища с этого ip без пароля
acl KnownUsers src "/etc/squid/KnownUsers.acl"
# все остальные
acl all src all
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl purge method PURGE
acl CONNECT method CONNECT
acl hasRequest has request
access_log daemon:/var/log/squid/access.log hasRequest
# доступ только с доверенных ip или по паролю
http_access allow Users
http_access allow KnownUsers
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access deny all
# превращаем squid в анонимный прокси
#forwarded_for off
header_access From deny all
header_access Server deny all
header_access User-Agent deny all
header_replace User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
header_access Referer deny all
header_replace Referer unknown
#header_access WWW-Authenticate deny all
header_access Link deny all
header_access X-Forwarded-For deny all
header_access Via deny all
header_access Cache-Control deny all
# отправять URL источника запроса, многие сайты без него ведут себя некорректно. При параноидальном подходе следует использовать
header_access Referer deny all
coredump_dir /var/spool/squid
# Отключаем дисковый кэш полностью
cache_mem 254 MB
cache_dir null /tmp
cache deny all
shutdown_lifetime 30 seconds
# обрезаем логи, хранить лишнюю информацию о нас не нужно
logformat squid %tl %ts.%03tu %6tr %>a %Ss/%03Hs %
access_log /var/log/squid/access.log
cache_store_log /var/log/squid/cashe.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern . 0 20% 4320
via off
forwarded_for off
Cashe.log
2023/02/20 14:47:08| Created PID file (/var/run/squid.pid)
2023/02/20 14:47:08 kid3| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid2| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid3| Creating missing swap directories
2023/02/20 14:47:08 kid3| No cache_dir stores are configured.
2023/02/20 14:47:08 kid2| Creating missing swap directories
2023/02/20 14:47:08 kid2| No cache_dir stores are configured.
2023/02/20 14:47:08 kid4| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid1| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid4| Creating missing swap directories
2023/02/20 14:47:08 kid4| No cache_dir stores are configured.
2023/02/20 14:47:08 kid1| Creating missing swap directories
2023/02/20 14:47:08 kid1| No cache_dir stores are configured.
2023/02/20 14:47:08| Removing PID file (/var/run/squid.pid)
2023/02/20 14:47:08| Created PID file (/var/run/squid.pid)
2023/02/20 14:47:08 kid1| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid2| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid4| Set Current Directory to /var/spool/squid
2023/02/20 14:47:08 kid1| Starting Squid Cache version 4.10 for x86_64-pc-linux-gnu...
2023/02/20 14:47:08 kid1| Service Name: squid
2023/02/20 14:47:08 kid1| Process ID 53197
2023/02/20 14:47:08 kid1| Process Roles: worker
2023/02/20 14:47:08 kid1| With 1024 file descriptors available
2023/02/20 14:47:08 kid1| Initializing IP Cache...
2023/02/20 14:47:08 kid1| DNS Socket created at [::], FD 5
2023/02/20 14:47:08 kid1| DNS Socket created at 0.0.0.0, FD 13
2023/02/20 14:47:08 kid1| Adding nameserver 208.67.222.222 from squid.conf
2023/02/20 14:47:08 kid1| Adding nameserver 208.67.220.220 from squid.conf
2023/02/20 14:47:08 kid2| Starting Squid Cache version 4.10 for x86_64-pc-linux-gnu...
2023/02/20 14:47:08 kid4| Starting Squid Cache version 4.10 for x86_64-pc-linux-gnu...
2023/02/20 14:47:08 kid1| Adding nameserver 127.0.0.1 from squid.conf
2023/02/20 14:47:08 kid1| helperOpenServers: Starting 5/5 'basic_ncsa_auth' processes
2023/02/20 14:47:08 kid2| Service Name: squid
2023/02/20 14:47:08 kid4| Service Name: squid
2023/02/20 14:47:08 kid4| Process ID 53194
2023/02/20 14:47:08 kid2| Process ID 53196
2023/02/20 14:47:08 kid2| Process Roles: worker
2023/02/20 14:47:08 kid2| With 1024 file descriptors available
2023/02/20 14:47:08 kid2| Initializing IP Cache...
2023/02/20 14:47:08 kid2| DNS Socket created at [::], FD 5
2023/02/20 14:47:08 kid2| DNS Socket created at 0.0.0.0, FD 13
2023/02/20 14:47:08 kid2| Adding nameserver 208.67.222.222 from squid.conf
2023/02/20 14:47:08 kid2| Adding nameserver 208.67.220.220 from squid.conf