H
H
hrvasiliy2015-10-26 14:46:56
PHP
hrvasiliy, 2015-10-26 14:46:56

How to determine client IP in nginx?

On nginx + php5-fpm server. It was necessary to determine the real IP of the client, after searching, I realized that such a problem is mostly in the apache + nginx bundle, but I only have nginx. I decided to look into the logs, the wrong IP is also written there.
How to configure the correct IP output for $_SERVER['REMOTE_ADDR'] + how to clean up the logs?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2015-10-26
@hrvasiliy

in the bundle you specified, by default, there will be a correct user ip, unless of course you have set any cloudflare or analogue before that.

A
Alexey Ostin, 2015-10-26
@nitso

lmgtfy.com/?q=nginx+php-fpm+real+ip

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question