Rewriting Response header from proxied server with Apache 2.0

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

 



Hello,

I'm setting up an Apache reverse proxy (for Apache 2.0.52 on RHEL4) and am
struggling with the following problem:

when mapping http://proxy/remote/ to http://remote/, I have been able to
replace all references to server remote using ProxyPass, ProxyPassReverse
and mod_proxy_html module to rewrite URLs in the HTML content.

However, the proxied application has "login" functionality and thus sets a
cookie.

While I have been working on the revrese proxy setup for the last couple
of days, I believe I'm now stuck: the proxied app is generating cookies
with domain "remote", which I want to replace with domain "proxy" so that
the client's browser will send the crorect cookie after logging in (as
opposed to being redirected to the login screen every time...).

I have googled and found content filters mod_substitute, mod_sed,
mod_ext_filter but these only change content, not response headers. I've
noticed that Apache 2.2 mod_proxy has directives to deal with cookie
domain and path - but I have Apache 20.!

Similarly, mod_headers has a "Header edit" command - but only for Apache 2.2!

So my question is: Using Apache 2.0 as a reverse proxy, how can I edit
(i.e. perform a substitution) on a response header (Set-Cookie in my case)
returned by a proxied server?

I'm thinking of something which can
1. save the contents of a response header to an environment variable
2. filter the variable
3. unset and rewrite response header using variable contents

But I'm not sure if mod_rewrite is suited to manipulations based on
RESPONSE headers (it does not seem to be).

Does anyone know of a workaround to change cookie domaisn and paths in an
Apache 2.0 reverse proxy?

Thanks,
Pieter



---------------------------------------------------------------------
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