Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Created May 18, 2019 09:32
Show Gist options
  • Save TheNicholasNick/17178f274a9e8c1f008fb41edbb8cd35 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/17178f274a9e8c1f008fb41edbb8cd35 to your computer and use it in GitHub Desktop.
squid.conf complete example allow ip
acl IP_OK src 12.13.14.15
acl SSL_ports port 443
acl SSL_ports port 8080
acl SSL_ports port 10443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access allow IP_OK
http_access deny all
http_port 3128
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
# go fast
dns_nameservers 1.1.1.1
cache_replacement_policy heap LFUDA
cache_dir rock /var/cache/squid 4000 min-size=102400
cache_mem 500 MB
maximum_object_size_in_memory 2 MB
memory_cache_mode always
memory_pools off
maximum_object_size 50 MB
cache_swap_low 90
cache_swap_high 95
quick_abort_min 0 KB
quick_abort_max 0 KB
client_db off
half_closed_clients off
# anon/private
via off
forwarded_for delete
# logs - docker
# mkdir -p /srv/docker/squid/cache
# chown 3128:3128 /srv/docker/squid/cache
# docker run \
# --name squid \
# --publish 3128:3128 \
# --volume /srv/docker/squid/squid.conf:/etc/squid/squid.conf:ro \
# --volume /srv/docker/squid/cache:/var/cache/squid \
# -d --rm \
# b4tman/squid
logfile_rotate 0
cache_store_log none
access_log stdio:/proc/self/fd/1
cache_log stdio:/proc/self/fd/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment