Re: mod_proxy_http and input filters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 = {
ÂÂÂ 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Ä <i.galic@xxxxxxxxxxxxxx>

----- "Lawrence S K Ong" <lawrence.s.k.ong@xxxxxxxxx> 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Ä

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

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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux