V
V
vanyok7462016-01-21 09:30:21
linux
vanyok746, 2016-01-21 09:30:21

How to allow access to the site in SQUID using regex?

Hello.
It is necessary to allow access to:
www.prostobank.ua/spravochniki/* on the squid , i.e. for pages:
www.prostobank.ua/spravochniki/otdeleniya/(city)/a...
www.prostobank.ua/spravochniki/ banki/(name)/alliance
etc. were available, but, for example, www.prostobank.ua/finansovyy_gid was blocked.
I tried the regular expression:
^http(s)?\:\/\/(www\.)?prostobank\.ua\/spravochniki.*$ but nothing opens
further than www.prostobank.ua/spravochniki .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2016-01-21
@CityCat4

([w]{1,3}\.)?prostobank\.ua/sparvochniki/.*$
In any case, similar regexps work for me both for blocking and for allowing

G
gilgameshfreedom, 2016-01-21
@gilgameshfreedom

You can try like this:
acl unallowed_site dstdom_regex ^(www.)?postobank.ua$
acl allowed_url url_regex ^ http://(www.)?prostobank.ua/spravochniki/?.*$
http_access allow allowed_url
http_access deny

unallowed_site 2 things
1. It will be necessary to manually add to the permission those urls that are loaded when opening any resource from here www.prostobank.ua/spravochniki/*
2. In your example

^http(s)?\:\/\/(www\.)?prostobank\.ua\/spravochniki.*$
https blocking at the url level will not be blocked, unless you have a ssl certificate substitution with subsequent traffic decryption.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question