nginx: dump HTTP requests for debugging

Adjust the number of pre/post lines (-B and -A args) as needed:

tcpdump -n -S -s 0 -A 'tcp dst port 80' | grep -B3 -A10 "GET /url"

This lets you get the HTTP requests you want, on the box, without generating a huge PCAP file that you have to offload somewhere else.

Keep in mind, that the BPF filter is never exact, if there are a large number of packets flowing through any box, BPF can and will drop packets.


I don't know exactly what you mean with dump the request but you can use tcpdump and/or wireshark to analyze the data:

# tcpdump port 80 -s 0 -w capture.cap

And you can use wireshark to open the file and see the conversation between servers.