Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Squid proxy server installed on my machine. I created a file /etc/squid/block.acl, where all the bad domains are written. And added the following statement to squid.conf:

acl bad_url url_regex "/etc/squid/block.acl"
http_access deny bad_url

Suppose, there is a domain: finam.ru. I want to block access to all its pages, except for these pages: finam.ru/analysis/*

How to do it? I tried regexp, but it doesn't work.

share|improve this question
up vote 1 down vote accepted
  1. Create a file /etc/squid/white.acl
  2. Put the following data there:

  3. Put this code into squid.conf. You have to put the whitelist before the blacklist:

    acl good_url url_regex "/etc/squid/white.acl"
    http_access allow good_url
    acl bad_url url_regex "/etc/squid/block.acl"
    http_access deny bad_url
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.