Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 21911 invoked from network); 17 Nov 2010 22:47:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 22:47:21 -0000 Received: (qmail 73928 invoked by uid 500); 17 Nov 2010 22:47:49 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 73905 invoked by uid 500); 17 Nov 2010 22:47:49 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 73897 invoked by uid 99); 17 Nov 2010 22:47:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 22:47:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lawrence.s.k.ong@gmail.com designates 209.85.213.45 as permitted sender) Received: from [209.85.213.45] (HELO mail-yw0-f45.google.com) (209.85.213.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 22:47:42 +0000 Received: by ywg4 with SMTP id 4so61865ywg.18 for ; Wed, 17 Nov 2010 14:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=/7H2eL9EXtjmXpvvF5Kjq73Tf17KMzcFj3kZ3WcFPYE=; b=eGKzTH9FQaTQlwcgE7Py8FS3V4cEf7fjyL128Grf7Ohv+KDOCv4XPIpcM/F7SDQQ6d YwqFAiYbsdah8PHKY5eMKJgT+gwMsUS8jD1HplWePDiaRYwmJjafiRRJbOd/YKH5R0kt kECcqr65lH45ymiIUF6CutIdzn2LlaylGPpLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AyuJM+mkUdN1zMNOubl1Enym//r47YCcZduYAsc0N5/FkiCmPuZwD4/qNgskW8LfET 7fbP3+HPGjS4sYNI0yAR+LHh8jasVvFJQhUklegZfUUaHpod4OIVFvnXS7uGcGkThaVP cW4zSf1SmwX5wb44Fnv7kW1zxb6P6d7ZiGO78= MIME-Version: 1.0 Received: by 10.231.14.136 with SMTP id g8mr5464631iba.74.1290034041340; Wed, 17 Nov 2010 14:47:21 -0800 (PST) Received: by 10.231.146.3 with HTTP; Wed, 17 Nov 2010 14:47:21 -0800 (PST) In-Reply-To: <1427743592.8786.1289945915662.JavaMail.root@iris> References: <1427743592.8786.1289945915662.JavaMail.root@iris> Date: Thu, 18 Nov 2010 09:47:21 +1100 Message-ID: From: Lawrence S K Ong To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=0003255745bec843310495477459 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] mod_proxy_http and input filters --0003255745bec843310495477459 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Igor, Thanks for the reply. Sorry, I did not include ProxyPassReverse in my initial post. The full "proxy" configurations are: ProxyPass /altlocation http://serverA/altlocation ProxyPass / http://defaultServer/ ProxyPassReverse / http://defaultServer/ As for the input filter, it is activated the moment that it is loaded. So what I have is: LoadModule myif_module /usr/lib64/httpd/modules/mod_myif.so Inside the code of the module itself, there are no "configuration" parameters, just a register filter immediately: static void register_hooks(apr_pool_t *p) { ap_register_input_filter("MYIF_IN", myif_filter_in, NULL, AP_FTYPE_CONNECTION); ap_hook_pre_connection(myif_pre_conn, NULL, NULL, APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA myif_module =3D { STANDARD20_MODULE_STUFF, NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ NULL, /* create per-server config structure */ NULL, /* merge per-server config structures */ NULL, /* command apr_table_t */ register_hooks /* register hooks */ }; Let me know if you require further information and thanks for the reply. Lawrence 2010/11/17 Igor Gali=C4=87 > > ----- "Lawrence S K Ong" wrote: > > > Can someone please help me with this issue? > > > > I have recently created an input filter. This input filter was created > > to modify the POST uri on the condition that the body matches a > > certain string. After the uri is modified, mod_proxy_http would send > > the correct POST uri to the backend server. Yes, this worked and the > > correct uri is sent to the backend server. However, when there are two > > ProxyPass configuration, there is an issue. > > > > For example: > > > > ProxyPass /altlocation http://serverA/altlocation > > ProxyPass / http://defaultServer/ > > This just shows us how you configured the proxy, which is all fine > (Except maybe for missing the ReverseProxyPass, see > http://www.apachetutor.org/admin/reverseproxies for a fully > working example; you can probably ignore the mod_proxy_html part) > > > The input filter converts the original URI to /altlocation if the body > > matches a certain condition. > > It does not however, show us how, exactly, you configured your > input filter. > > > The issue is that I always hit http://defaultServer/ rather than > > http://serverA/altlocation . It seems that this issue is occuring > > because the determination of which server to proxy to is performed > > after the header is sent, and not after the body arrives. > > > > Does anyone know how I can avoid this? > > > > Thanks, > > Lawrence > > > i > > -- > Igor Gali=C4=87 > > Tel: +43 (0) 664 886 22 883 > Mail: i.galic@brainsware.org > URL: http://brainsware.org/ > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project= . > See for more info. > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > " from the digest: users-digest-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > --0003255745bec843310495477459 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Igor,

Thanks for the reply.

Sorry, I did not include ProxyPas= sReverse in my initial post.=C2=A0 The full "proxy" configuration= s are:

ProxyPass /altlocation http://serverA/altlocation
ProxyPass / http://defa= ultServer/
ProxyPassReverse / http://defaultServer/<= /a>

As for the input filter, it is activated the moment that it is l= oaded.=C2=A0 So what I have is:

LoadModule myif_module /usr/lib64/ht= tpd/modules/mod_myif.so

Inside the code of the module itself, there are no "configuration&= quot; parameters, just a register filter immediately:

static void re= gister_hooks(apr_pool_t *p)
{
=C2=A0=C2=A0=C2=A0 ap_register_input_fi= lter("MYIF_IN", myif_filter_in, NULL,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 AP_FTYPE_CONNECTION);
=C2=A0=C2=A0=C2=A0 ap_hook_pre_= connection(myif_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
}

module = AP_MODULE_DECLARE_DATA myif_module =3D {
=C2=A0=C2=A0=C2=A0 STANDARD20_M= ODULE_STUFF,
=C2=A0=C2=A0=C2=A0 NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 /* create per-directory config structure */
=C2=A0=C2=A0=C2=A0 NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* merge pe= r-directory config structures */
=C2=A0=C2=A0=C2=A0 NULL,=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 /* create per-server config structure */
=C2=A0= =C2=A0=C2=A0 NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* merge per-serv= er config structures */
=C2=A0=C2=A0=C2=A0 NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* command = apr_table_t */
=C2=A0=C2=A0=C2=A0 register_hooks=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* register hooks */
};

Let = me know if you require further information and thanks for the reply.
Lawrence

2010/11/17 Igor Gali=C4=87 <i.galic@brainsware.org>

----- "Lawrence S K Ong" <lawrence.s.k.ong@gmail.com> wrote:

> Can someone please help me with this issue?
>
> I have recently created an input filter. This input filter was created=
> to modify the POST uri on the condition that the body matches a
> certain string. After the uri is modified, mod_proxy_http would send > the correct POST uri to the backend server. Yes, this worked and the > correct uri is sent to the backend server. However, when there are two=
> ProxyPass configuration, there is an issue.
>
> For example:
>
> ProxyPass /altlocation http://serverA/altlocation
> ProxyPass / http:/= /defaultServer/

This just shows us how you configured the proxy, which is all fine (Except maybe for missing the ReverseProxyPass, see
http://www.apachetutor.org/admin/reverseproxies for a fully
working example; you can probably ignore the mod_proxy_html part)

> The input filter converts the original URI to /altlocation if the body=
> matches a certain condition.

It does not however, show us how, exactly, you configured your
input filter.

> The issue is that I always hit http://defaultServer/ rather than
> http://server= A/altlocation . It seems that this issue is occuring
> because the determination of which server to proxy to is performed
> after the header is sent, and not after the body arrives.
>
> Does anyone know how I can avoid this?
>
> Thanks,
> Lawrence


i

--
Igor Gali=C4=87

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org<= br> URL: http://brainsware= .org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.<= br> See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
=C2=A0 " =C2=A0 from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


--0003255745bec843310495477459--