Can mod_proxy be configured to write all HTTP traffic to a log file, including request and response headers and body?
migrated from webmasters.stackexchange.com Nov 17 '10 at 18:18
This question came from our site for pro webmasters.
Elaborating on ErikA's answer:
A simple way of doing this is to capture all traffic on port 80 to a file:
And then use "strings" to extract the text content of the packets:
This will include some garbage but will generally get you what you need. You can also use the "Follow TCP Stream" feature in Wireshark to get a cleaner version of the same thing.
Life is a little more difficult if you're working with SSL traffic. A typical solution would be to use stunnel to intercept the SSL traffic and then proxy it to your web server over the loopback interface; this lets you capture the unencrypted traffic.