Discussion:
map depending on HTTP header
Jon Fullmer
2017-05-03 15:04:41 UTC
Permalink
Currently using TrafficServer 4.2.3 on CentOS (happy to upgrade, if later versions provide the needed feature).

I want to be able to map the backend call based on the source IP address of the caller and the contents of a custom HTTP header.

For example (the curly braces represent something that doesn’t exist):

regex_map http://(.*)/ http://{client-ip}:{contents-of-custom-HTTP-header}/

Do such macros exist?

Thanks in advance.

- Jon
Jon Fullmer
2017-05-03 15:09:26 UTC
Permalink
(Sorry about the previous message)

Currently using TrafficServer 4.2.3 on CentOS (happy to upgrade, if later
versions provide the needed feature).

I want to be able to map the backend call based on the source IP address of
the caller and the contents of a custom HTTP header.

For example (the curly braces represent something that doesn’t exist):

regex_map http://(.*)/ http://
{client-ip-address}:{contents-of-custom-HTTP-header)/

Do such macros exist?

Thanks in advance.

- Jon
Shu Kit Chan
2017-05-03 17:26:44 UTC
Permalink
You can try the header_rewrite plugin
https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html

I don't know too well whether TS 4.2.3's header_rewrite plugin has
enough features for your needs. But I believe the latest ones does
have everything you need.

You can also use the ts_lua plugin as well if you are using later
version of trafficserver.

Thanks.
Post by Jon Fullmer
(Sorry about the previous message)
Currently using TrafficServer 4.2.3 on CentOS (happy to upgrade, if later
versions provide the needed feature).
I want to be able to map the backend call based on the source IP address of
the caller and the contents of a custom HTTP header.
regex_map http://(.*)/
http://{client-ip-address}:{contents-of-custom-HTTP-header)/
Do such macros exist?
Thanks in advance.
- Jon
Continue reading on narkive:
Loading...