Files
2026-06-17 00:05:23 +02:00

55 lines
1.2 KiB
SquidConf

# Define the port Squid listens on
http_port 3128
# Access control lists
acl localnet src 172.16.0.0/12
# Allowed ports for CONNECT method (HTTPS tunneling)
acl SSL_ports port 443
acl Safe_ports port 80 # HTTP
acl Safe_ports port 443 # HTTPS
acl Safe_ports port 1025-65535 # High ports
# Custom ACL lists
acl whitelist dstdomain "/etc/squid/whitelist.txt"
acl keyword_block url_regex "/etc/squid/keywordblock.txt"
# Custom error pages
error_directory /etc/squid/errors
deny_info ERR_BLOCKED_BLOCKLIST keyword_block
deny_info ERR_BLOCKED all
# Deny access to unsafe ports
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
# Block blocklist
http_access deny keyword_block
# Allow whitelist
http_access allow whitelist
# Allow local network access
# http_access allow localnet
# http_access allow localhost
# Deny everything else
http_access deny all
# Cache settings - 1GB disk cache, 256MB memory cache
cache_mem 256 MB
maximum_object_size_in_memory 4 MB
cache_dir ufs /var/spool/squid 1000 16 256
maximum_object_size 100 MB
# Log format
access_log /var/log/squid/access.log squid
# DNS settings
dns_nameservers 8.8.8.8 8.8.4.4
# Proxy identity (hide version info)
httpd_suppress_version_string on
via off
forwarded_for delete