I have a very specific need of allowing access to an unknown set of domains where they all have a common domain as referral.

Put the other way around I have a website including items (js, images, css, etc) from an unknown set of domains which I need to allow access through to.

I know referrals are set client side and can be edited. This is not a concern in this case as the users are already authenticated via credentials and logged.

Is allowing access based on referral possible in Squid?


You can, using the referer acl-type - quoting the manual:

acl aclname referer_regex [-i] regexp ...
  # pattern match on Referer header [fast]
  # Referer is highly unreliable, so use with care

An example configuration that should work:

acl myreferer referer_regex -i ^http://www.example.org
http_access allow myreferer
| improve this answer | |
  • Is this correct? I thought . was a metacharacter for any character – Nathan Goings Jan 21 '16 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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