On Aug 12, 2013, at 7:34 PM, Scott Harris <[email protected]> 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

Reply via email to