Last active
May 21, 2021 10:10
-
-
Save salrashid123/97c6daa35467e36a6d0928f3b6787285 to your computer and use it in GitHub Desktop.
Minimal squid.conf to deny destination host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) create a file squid.conf | |
``` | |
acl denydomain dstdomain .bbc.com | |
http_access deny denydomain | |
acl allowdomain dstdomain .yahoo.com | |
http_access allow allowdomain | |
http_access deny all | |
http_port 3128 | |
access_log /apps/squid/var/logs/access.log squid | |
cache_log /apps/squid/var/logs/cache.log squid | |
``` | |
2) then run the squid-proxy image i setup and reference the file via volume: | |
# docker run -v `pwd`:/tmp/squid/ -p 3128:3128 -t salrashid123/squidproxy /apps/squid/sbin/squid -NsY -f /tmp/squid/squid.conf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in a new window use curl and specify the proxy:
you'll see it allows yahoo over http and https but denies all other domains