trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Hedstrom <zw...@apache.org>
Subject Re: remap based on useragent
Date Tue, 13 Aug 2013 01:55:11 GMT
On Aug 12, 2013, at 7:34 PM, Scott Harris <scott@harrisnet.id.au> wrote:

> With our migration to ats we have a requirement to do remaps to different origin servers
based on useragent.
> 
> Is there a way to do this with ats or existing plugin or will i need to write my own
plugin to do this?
> 
> Scott


I think the header_rewrite plugin can do this. Been a while since I used it, but something
like (try this carefully though)

# This is a configuration example when used as a remap plugin  rule

  cond %{HEADER:User-Agent} /safari/
  set-destination HOST safari.example.com [L]

  cond %{HEADER:User-Agent} /msie/
  set-destination HOST msie.exapmple.com  [L]

  cond %{HEADER:User-Agent} /mozilla/
  set-destination HOST mozilla.example.com [L]



If you want to use it as a global plugin (that applies to all requests regardless of which
remap rule triggers), you have to add a condition like

cond %{READ_REQUEST_HDR_HOOK}


Again, this is right out of my bu^h^h head, check out the README. I could not see any docs
for the plugin in Sphinx, not sure if we have one or not ? I should probably write one if
there isn't one ...

Cheers,

-- Leif
Mime
View raw message