12

How do I restrict access to only one website through my Squid proxy?

The following doesn't work...

acl amazon_ireland src 79.125.0.0/17
acl some_site url_regex google

http_access allow amazon_ireland
http_access allow some_site
http_access deny all
Fenelon
  • 700
  • 2
  • 6
  • 16

2 Answers2

26

Have a look at the squid FAQ, there is a perfect example for your setup.

Squid FAQ

 acl GOOD dst 10.0.0.1
 http_access allow GOOD
 http_access deny all

if you want to match by domain-name

 acl GOOD dstdomain .amazon.ie
 http_access allow GOOD
 http_access deny all
dwalter
  • 7,258
  • 1
  • 32
  • 34
2

Here is another way, where you can specify the source IP addres. And block specific sites such as youtube facebook

acl liberaip src 130.44.0.215
acl block url_regex -i youtube facebook
http_access allow liberaip !block
Cleber Reizen
  • 420
  • 4
  • 11
  • Smart answer! I would like to add: change to ***acl allow url_regex ...*** AND change to ***http_access allow ipranges allow*** To allow only these site to the IP given. (reverse) – Tarik Aug 31 '17 at 10:52
  • After revisiting this question. I noticed your comment is more suitable to OP question. =P – Cleber Reizen Sep 02 '17 at 00:23