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

4
  • Why would you wanna do it ?
    – Ahtisham
    Jan 23, 2019 at 15:40
  • For my own reasons. There is a hacker that gets acces I want to know how. :) Jan 23, 2019 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 Jan 23, 2019 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?\ Jan 23, 2019 at 20:57

0

You must log in to answer this question.

Browse other questions tagged .