How to get REMOTE_ADDR in access logging.log for unix socker fpm + nginx?

Hello,

for some time tormented by the question of logging in access.log fpm address of the visitor.
Now nginx + fpm as unix socket is connected. All works fine, but in access.log not sent the visitor's IP address, although when you run such a code on the website :
<?php echo $_SERVER['REMOTE_ADDR']; ?>
The address is displayed correctly.

In the log instead of the address like so :
- - 28/Apr/2016:10:00:53 +0300 "GET /i.php
July 12th 19 at 17:26
2 answers
July 12th 19 at 17:28
Solution
Try adding %{REMOTE_ADDR}e - in access.format

Found here https://gist.github.com/fprochazka/1853008#file-ph...
and in the PHP sourcegit.php.net/?p=php-src.git;a=blob;f=sapi/fpm/fpm/f...
when you run this code here on the website :

The address is displayed correctly. - felicita.Keeling65 commented on July 12th 19 at 17:31
: you have to dig in config PHP-FPM access.format. - Paxton28 commented on July 12th 19 at 17:34
: In access.format there is only one option - %R ( ; %R: remote IP address ) - felicita.Keeling65 commented on July 12th 19 at 17:37
Try %{REMOTE_ADDR}e - Paxton28 commented on July 12th 19 at 17:40
Found here https://gist.github.com/fprochazka/1853008#file-ph...
and in the PHP source git.php.net/?p=php-src.git;a=blob;f=sapi/fpm/fpm/f... - Paxton28 commented on July 12th 19 at 17:43
Super, thank you very much, it works. - felicita.Keeling65 commented on July 12th 19 at 17:46
Corrected the answer - Paxton28 commented on July 12th 19 at 17:49
July 12th 19 at 17:30
approximately
https://support.cloudflare.com/hc/en-us/articles/2...

but one little nginx, thou fpm does not transmit
All variables are spelled out and regular code works,but the fpm access.log gives dashes. - felicita.Keeling65 commented on July 12th 19 at 17:33

Find more questions by tags PHP-FPMNginx