trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Hedstrom <zw...@apache.org>
Subject Re: problem when rewrite host header with plugin header_rewrite
Date Thu, 09 Mar 2017 15:25:47 GMT
You can do this with map_regex without a plugin I think.

-- Leif 

> On Mar 9, 2017, at 1:15 AM, 彭勇 <ppyy@pubyun.com> wrote:
> 
> I would like to like rewrite host header with regex:
> 
> some.domain.abc.com -> some.domain
> 
> here is regex:
> 
> /(.*)\.abc\.com$/  ->  $1
> 
> i dig into header_rewrite doc and code, but i don't know how to write
> the rewrite rule with regex:
> 
> cond %{SEND_REQUEST_HDR_HOOK}
> cond %{HEADER:HOST} /(.*)\.abc\.com$/
> set-header host how_to_write_some_regex_value
> 
> 
> here is some hint in document:
> 
> Setting a header with a value can take the following formats:
> 
> Any condition which extracts a value from the request.
> $N, where 0 <= N <= 9, from matching groups in a regular expression.
> 
> 
> 
> -- 
> Peng Yong


Mime
View raw message