Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to create an acl in Squid such that specific locations within a domain can be blocked.

For example:

I want to allow the domain example.com and all the pages except the following.

example.com/home.php
example.com/#!/
example.com/home.php#!/profile.php

I want to have an exact match of the pattern in the URL. If the pattern is not matched it should allow otherwise deny.

Can anyone please suggest me how do I do this ?

Warm Regards

Supratik

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The way I have it configured is like this: I have a file with the blocked url patters and in the squid.conf I have the following lines

acl blocked url_regex "/path/to/my/file"
http_access deny blocked

And that's all. "/path/to/my/file" looks like this

porn # for every url having the string porn on it
orkut.com $ for the full domain
.*avg.com/.*\.bin$ # for the url with  avg.com domain and asking for the file *.bin

Hope it works for you

share|improve this answer
    
I tried your suggestions it works fine. But if I allow a domain and try to restrict some pages it's not working for HTTPS. I figured out that Squid sees the URL in encrypted form once the connection is established. Thanks for your help. –  Supratik Jul 27 '11 at 5:37
add comment

Your Answer

 
discard

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.