0

I want to set up a nginx rule that will log every request ever made on my site including cookies. For example for a single php script I can get the full request body with this code:

print_r($_SERVER);

But I want to log every request that is being made on php scripts on my nginx server. Any idea how to do it?

Thank you

  • Why would you wanna do it ? – Ahtisham Jan 23 at 15:40
  • For my own reasons. There is a hacker that gets acces I want to know how. :) – Born vs. Me Jan 23 at 16:13
  • You could use tcpdump with port specification to sniff all the traffic going towards that particular tcp port. You could also specify source IP if you know the IP, you can always block it using fail2ban. e.g.: tcpdump tcp port 80 – Dmitriy Kupch Jan 23 at 20:25
  • tcpdump tcp port 80 does this log everything? his ip, his headers, request uri etc ? How do save it on a folder on each request?\ – Born vs. Me Jan 23 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.