Is there a way to log requests going through mod proxy? I need a way to debug my configuration, because I don't seem to be getting where I should be. I need the following information:
- headers of incoming requests
- what is being sent to the proxy target
Maybe a related question: is there a way to strip some headers? I tried the following:
ProxyPass /proxy/other http://not.under.my.control/
<Location /proxy/other>
ProxyPassReverse /
RequestHeader unset Authorization
</Location>
I don't really know whether this is ok, because I don't see anything.
I used dumpio. I put the following in
/etc/httpd/conf.d/dumpio.conf
:An often forgotten piece is setting the LogLevel to debug. Without it, you won't actually see any DumpIO output.
The log output is written to the error log for the virtual host and/or the server.
If you change LogLevel to debug it'll give you more detail about what's going on in the standard Error log.
That'll get you plenty of information about what's happening.
You can also append
proxy:trace5
to your existingLogLevel
directiveIf you have this
Change it to this
Be sure to change that back to normal after use. This will create huge log files fast.
Another option might be
mod_forensic
, can easily log the request and headers etc. Beware of disk space usage though, on a heavy load web-site mod_forensic can easily produce tens of Gigs per day.http://httpd.apache.org/docs/2.2/mod/mod_log_forensic.html
mod_security can log request body & headers, among other things. Link
You can use these logs, but they won't give you exactly what you want :