httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] Rewriting Response header from proxied server with Apache 2.0
Date Wed, 01 Apr 2009 12:02:06 GMT

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

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?


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message