Showing results for 
Search instead for 
Did you mean: 

Squid - acl time

Nirmal raj
Occasional Visitor

Squid - acl time

hi i have a problem when i create a time based acl in squid.conf file its not working ,

our system follows gmt+05.30 can u tell me a solution

citation I:

acl bad url_regex"/etc/squid/squid.conf"

acl lunch time MTWHF 13:00-14:00
acl afterhours time MTWH 17:30-23:59
acl afterhoursf time F 16:30-23:59
acl morning time MTWHF 00:01-08:29

http_access deny bad lunch
http_access allow bad

Ivan Ferreira
Honored Contributor

Re: Squid - acl time

¿Why do you have 4 acl if only one is used?

You only need to set:

acl bad url_regex "/etc/squid/squid.conf"
acl lunch time MTWHF 13:00-14:00
http_access deny bad lunch

¿What do you mean with "not working", access is granted or denied?

You must check other rules and their order also.

¿did you reload squid?

Run "squid -k parse" to check ro syntax error, in your example you miss a space in acl bad.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Krastev
Honored Contributor

Re: Squid - acl time

Be very careful with squid acl lists. When the first acl match the client request they will not be processed further.

For example if you have client with ip and you write before this acl another with

acl good_ip
http_access allow good_ip

the rest of the acl's will not be processes for this request.