Answer the question
In order to leave comments, you need to log in
How to achieve logging REMOTE_ADDR in access.log for fpm unix socker + nginx?
Hello,
I've been struggling with the issue of logging visitor addresses in access.log fpm for some time now.
Now nginx + fpm is connected as unix socket. Everything works fine, only the visitor's IP address is not transmitted to access.log, although when executing this code on the site:
The address is displayed correctly.
In the log instead of the address like this:echo $_SERVER['REMOTE_ADDR'];
- - 28/Apr/2016:10:00:53 +0300 "GET /i.php
Answer the question
In order to leave comments, you need to log in
Try adding it %{REMOTE_ADDR}e
to access.format
Found here https://gist.github.com/fprochazka/1853008#file-ph...
and in the PHP sources git.php.net/?p=php-src.git;a=blob ;f=sapi/fpm/fpm/f...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question