Welcome! Log In Create A New Profile

Advanced

ngx_http_limit_req_module + proxy = wrong logs???

Posted by x-man 
ngx_http_limit_req_module + proxy = wrong logs???
March 02, 2015 10:13PM
Hi,
I using nginx latest stable version on two servers, first one is with ddos protection and every request to my website first go to that server and that server working as nginx proxy for second server where I also have all rest (nginx, php, mysql...)...

Because somebody attack my website (layer 7 attack - only php script) I want to limit parallel requests to main php script and that is homepage and I do it with ngx_http_limit_req_module on second server because on that server I have php scripts and I do it on this way:
limit_req_zone $http_x_forwarded_for zone=two:10m rate=1r/s;

location ~ \.php$ {
limit_req zone=two burst=5;
}

and this working very good but in error log file I don`t have attacker IP, nginx always log first server ip (proxy server), why? How to fix this? Like you can see I using $http_x_forwarded and this working, server bloking attacker IP but logging wrong IP...

Sorry for bad english!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready