Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9F97A200C41 for ; Fri, 10 Mar 2017 01:48:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9E006160B84; Fri, 10 Mar 2017 00:48:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E898A160B75 for ; Fri, 10 Mar 2017 01:48:34 +0100 (CET) Received: (qmail 17020 invoked by uid 500); 10 Mar 2017 00:48:29 -0000 Mailing-List: contact users-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@trafficserver.apache.org Delivered-To: mailing list users@trafficserver.apache.org Received: (qmail 17010 invoked by uid 99); 10 Mar 2017 00:48:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2017 00:48:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 82C49C132E for ; Fri, 10 Mar 2017 00:48:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=juyide.com header.b=LzPfUhNw; dkim=pass (1024-bit key) header.d=pubyun.com header.b=B5YW/yJO Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 0Oqomvksc6bJ for ; Fri, 10 Mar 2017 00:48:23 +0000 (UTC) Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id EDCF65F1EE for ; Fri, 10 Mar 2017 00:48:22 +0000 (UTC) Received: by mail-wr0-f174.google.com with SMTP id l37so55726439wrc.1 for ; Thu, 09 Mar 2017 16:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juyide.com; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-transfer-encoding; bh=W5r7L8WYGDJE3Fa0GWRDcgXxoLsK2UoGP+7kZ21VccU=; b=LzPfUhNwPWWD4gTRW2W0WuFd/wsOtmi4n4Fwyvg2eov561VY8KmKBECShNwZQjSwUz a9awTDQwftz3oEocDdyUifCQGpffLAuFhIzINvWBTnbW/OZiFO7r9s8J+Klq1agF4gLV Wz4WeMMvNOlCUMOIi9y01uAI1ZTqZD2HuoBgs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pubyun.com; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-transfer-encoding; bh=W5r7L8WYGDJE3Fa0GWRDcgXxoLsK2UoGP+7kZ21VccU=; b=B5YW/yJOtenwXo48Fx694enht8Ti9NK2Xrz8yMkDpmOfNcmcmGkrkcGz96qX78ypQD 6+sxLXkB6g38bF57RmhLuvc4CFTo02ChCW2qR0SXOT8kg7naJZUyoAPbcna4a30fO0Gu 0XnQ6/PCAv/1IhYdO6Bqat1e8XdkwLKxVMTHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-transfer-encoding; bh=W5r7L8WYGDJE3Fa0GWRDcgXxoLsK2UoGP+7kZ21VccU=; b=S+4MkZV8911LjtSig8LQDXLCcdR8X0QagE+X+mSmN0SULwV3HxQwcr09TuTraT7oWS I9lKmDvldd8BthTlpP/nfSrqsaeyBBOIja0do8uRyFCgxsfwOTpWpKq7irY4XlgzIlzF R2wH2sexxz9wDB24nvjwF5117zzBwadPa6MPsH8MJrERUPAjQlJv9nZhod96MFnpQ6RK AnPyslEGrGnYzOkkaxd84w2p9sF9h2pXETanpFUn2l6wS6nlowanjlvvAwjE19dUenKb Ga94ZJ3wjxfJS5GzpX4N8PJ4TLYUVoU/jRITqXgtATOWsZv1b6HumrMHc6dociy5MgqC XLAQ== X-Gm-Message-State: AMke39myHy/zavao1cjYgFgqVFQpEhuRzqtS6S7ybbbJEWDwW1ngWVnCLereTdVz8Qwa8BKkZVfJCNZNuxbloQ== X-Received: by 10.223.173.169 with SMTP id w38mr13138892wrc.177.1489106454654; Thu, 09 Mar 2017 16:40:54 -0800 (PST) MIME-Version: 1.0 Sender: ppyy@juyide.com Received: by 10.223.153.67 with HTTP; Thu, 9 Mar 2017 16:40:34 -0800 (PST) X-Originating-IP: [103.251.128.89] In-Reply-To: <4DA7F509-913D-468A-BB9B-945426961FE0@apache.org> References: <4DA7F509-913D-468A-BB9B-945426961FE0@apache.org> From: =?UTF-8?B?5b2t5YuH?= Date: Fri, 10 Mar 2017 08:40:34 +0800 X-Google-Sender-Auth: Du_cTJI6O4ELqi1IJUnfOadmons Message-ID: Subject: Re: problem when rewrite host header with plugin header_rewrite To: users@trafficserver.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Fri, 10 Mar 2017 00:48:35 -0000 thanks zwoop, i would like to only rewrite the host header and not the origin server. the map_regex will rewrite the host header and the origin server. On Thu, Mar 9, 2017 at 11:25 PM, Leif Hedstrom wrote: > You can do this with map_regex without a plugin I think. > > -- Leif > >> On Mar 9, 2017, at 1:15 AM, =E5=BD=AD=E5=8B=87 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 <=3D N <=3D 9, from matching groups in a regular expression. >> >> >> >> -- >> Peng Yong > --=20 Peng Yong