Server Fault is a question and answer site for system and network administrators. 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'm trying to open a web, but my squid is blocking that url, in squid.conf, i have this

acl neverallow url_regex -i "/usr/local/squid/etc/blacklist/neverallow"
http_access deny neverallow

if i comment the http_access line, i'm able to open the url, so, i open the file looking for the domain name, or something that looks like the url i'm trying to open, but, couldn't find nothing with my own eyes, so, i'm not an expert in linux, and i don't know how to google this, my question is, is there a way that i can manually( a command, program, etc.) test the url i'm trying to open with the ones saved in the file and know which one is the match??

I'm using Debian 6

share|improve this question
well regex can be tricky !! it would be helpful if you had included "neverallow" files' content and the website you were trying to visit via proxy. – kaji Jul 22 '12 at 14:55
up vote 0 down vote accepted

Have you tried the DEBUG_OPTIONS ?

debug_options ALL,1 33,2 28,9

And then take a look to cache.log

Don't forget comment the above line after debugging....

share|improve this answer

Try this script. It should be used in this manner:

$ cat your_url_regex_list_file | ./ url_to_be_tested

so that,

$ cat blacklist.txt | ./

will show the line number of the lines matching the string provided within the file.



my $url = $ARGV[0];
my $tst = 0;
my $lnb = 1;

print "Searching: [$url]...\n";
while (<STDIN>)
    my $item = $_;

    if ($url =~ /$item/)
            print "! $lnb [$url] in |$item| \n";

if ($tst == 0) { print "no one found\n"; }
share|improve this answer
Your script is awesome, thanks, but one more thing, what about if i try with something like this (http://|www\.)in\.com, i get en error like this -bash: syntax error near unexpected token http://'` – Castro Roy Mar 7 '13 at 17:03
It also doesn't work with url like this:‌​text=seguridad+inform%C3%A1tica&file=#submit – Castro Roy Mar 7 '13 at 17:17

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.