the lua plugin also has this functionality although may be somewhat overkill for your needs.


On Tue, Jan 24, 2017 at 1:43 PM, Adi Mallikarjuna Reddy V <adimallikarjunareddy@gmail.com> wrote:
So to achieve my use case, can I try something like this?

map / http://b.bar.com @plugin=header_rewrite.so @pparam=rules1.conf
and my rules1.conf has
cond %{HEADER:MY_HEADER} = "foo"
set-destination HOST mobile.bar.com [L]
This should forward the request to mobile.bar.com if the request has 'MY_HEADER' with value 'foo'.

Thanks
Adi


On Tue, Jan 24, 2017 at 11:36 AM, Brian Geffon <briangeffon@gmail.com> wrote:

Sorry I think I meant header_rewrite.

Brian


On Tue, Jan 24, 2017, 11:26 Brian Geffon <briangeffon@gmail.com> wrote:
There is a regex_remap plugin that is what you would want, take a look in plugins/

Brian


On Tue, Jan 24, 2017, 11:25 Adi Mallikarjuna Reddy V <adimallikarjunareddy@gmail.com> wrote:
Is there a config that allows to change remap rule based on the incoming header?


My use case is , if I send a custom header in the request, the remap rule should be changed to different one than the default one configured.


Thanks

Adi