Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured an Apache 2.2 server as forward proxy using mod_proxy and mod_proxy_http

In my application that uses that proxy I need to modify http requests. (Requests means the request that goes to the origin server of the content. I dont want to manipulate the response that goes back to the client)

I am already sucessfully altering/adding cookies using RequestHeader from mod_headers.

I am also manipulating GET data using RewriteRule from mod_rewrite.

Now my question is whether there is a way to alter post data.

edit:

to clarify the intended usage and whether i am running a forward or a reverse proxy here is my server including modifications to urls and headers:

RewriteEngine on
ProxyRequests On
ProxyVia Off
<Proxy *>
    Order deny,allow
    Allow from all
    AuthType Basic
    AuthName "Password Required"
    AuthUserFile /home/proxy/authfile
    Require valid-user
</Proxy>

# lets have a sample rewrite rule
<ProxyMatch "http://sample-host.com/something.php\?param=value&u=(.+)&p=(.+)&format=xml">
    RewriteEngine on
    RewriteRule . http://sample-host.com/something.php?param=value&u=secret&p=evenmoresecret&format=xml [P]
</ProxyMatch>

# lets modify some headers
<ProxyMatch "http://example\.net/somepath/(.+)/someotherpath">
        RequestHeader set Cookie "auth=secret;login=&id=secret"
        # do not disclose cookie to the client
        Header unset "Set-Cookie"
</ProxyMatch> 

in a similar way i want to edit post data!

share|improve this question
    
mod_substitute logs promising but it only acts on response bodys! –  The Shurrican Jun 5 '11 at 23:35
    
what makes you think i have a reverse proxy? to clarify i added my server config to the questino! –  The Shurrican Jun 6 '11 at 1:45
    
right now i have a workaround in place that ACTUALLY uses a reverse proxy. but i would like to get rid of that. –  The Shurrican Jun 6 '11 at 1:46
    
@Joe - I realised my mistake and deleted my comment - I thought I'd got to it before you'd seen it ;) –  Mark Henderson Jun 6 '11 at 4:24
    
oh okay now you officially trolled me :D –  The Shurrican Jun 6 '11 at 15:57
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.