Welcome! Log In Create A New Profile

Advanced

Logging client IP on invalid request

Posted by kuula 
Logging client IP on invalid request
May 06, 2020 12:43PM
I'm running nginx behind a proxy and use the real IP module along with the X-Forwarded-For header to log the real client address in access.log. This works fine for normal requests, but fails with an invalid one.

I enabled connection debugging to find this:

2020/05/06 10:21:58 [info] 1181#1181: *53597678 client sent invalid request while reading client request line, client: <proxy address>, server: _, request: "GET <a broken request> HTTP/1.1"

I couldn't find any headers in the debug log for that request, so the logging probably happens too soon prior to headers being parsed in the case of an invalid request?

The invalid requests are not the problem. They come from a tester that sends all manner of things. I'd like to have the real client address in the log in these cases too. Is there anything that can be done?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready