request_header_replace User-Agent 'UA string' for certain URLs/domains/ACLs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

request_header_replace User-Agent 'UA string' for certain URLs/domains/ACLs

Igor Rylov
How to change User-Agent string only for certain ACLs, for example,
If I set up an: acl acl_name dst some.url
or: acl acl_name url_regex some\.url\/path
or sources IPs: acl acl_name src 192.168.0.123

Then use the User-Agent replacement for the configured acl:

request_header_replace User-Agent User-Agent-String

I can only do as above, but how can I apply the request_header_replace to only work with a configured acl_name?

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: request_header_replace User-Agent 'UA string' for certain URLs/domains/ACLs

Amos Jeffries
Administrator
On 10/09/19 10:28 am, Igor Rylov wrote:

> How to change User-Agent string only for certain ACLs, for example,
> If I set up an: acl acl_name dst some.url
> or: acl acl_name url_regex some\.url\/path
> or sources IPs: acl acl_name src 192.168.0.123
>
> Then use the User-Agent replacement for the configured acl:
>
> request_header_replace User-Agent User-Agent-String
>
> I can only do as above, but how can I apply the request_header_replace
> to only work with a configured acl_name?


To use the *_header_replace directives you need to also have a matching
*_header_access deny line to prevent the original header(s) from being used.

Like so:

  request_header_access User-Agent deny acl_name

  request_header_replace User-Agent User-Agent-String


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users