Hi,
yes %R return the client address of FPM, which means it will log your nginx
IP address, not the IP of the nginx client (the browser).
So for now it's not possible to include in the logs input headers (like
HTTP_X_FORWARDED_FOR). You can use %o{xxxx} for output headers but input
headers are not supported yet. Feel free to publish a patch to fpm_log.c (
https://github.com/php/php-src/blob/master/sapi/fpm/fpm/fpm_log.c)
++ jerome
2013/6/13 Joe <ext@originalmind.com.au>
> Hi Ali,
>
> Have a look at the reference conf file from the source here:
> https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in
>
> I believe %R will work for you, although from memory you need to set up
> the correct fastcgi parameter to get the correct IP through to php.
>
>
> On Wednesday, 12 June 2013 19:37:43 UTC+10, Ali Trix wrote:
>>
>> Hi,
>>
>> Is it possible to make a custom log with php-fpm where I can add
>> environment variables?
>> I ask this, because I want to add the IP of the user which caused the
>> access/error log.
>>
>> We run a nginx<->php-fpm combination.
>> Previously we had apache2 and that showed us the IP of the users on every
>> access/error line, so we could debug which user caused the Fatal to fix the
>> bug.
>>
>> Anyone has experience with php-fpm to fix this issue?
>>
>> Ali
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "highload-php-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to highload-php-en+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
yes %R return the client address of FPM, which means it will log your nginx
IP address, not the IP of the nginx client (the browser).
So for now it's not possible to include in the logs input headers (like
HTTP_X_FORWARDED_FOR). You can use %o{xxxx} for output headers but input
headers are not supported yet. Feel free to publish a patch to fpm_log.c (
https://github.com/php/php-src/blob/master/sapi/fpm/fpm/fpm_log.c)
++ jerome
2013/6/13 Joe <ext@originalmind.com.au>
> Hi Ali,
>
> Have a look at the reference conf file from the source here:
> https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in
>
> I believe %R will work for you, although from memory you need to set up
> the correct fastcgi parameter to get the correct IP through to php.
>
>
> On Wednesday, 12 June 2013 19:37:43 UTC+10, Ali Trix wrote:
>>
>> Hi,
>>
>> Is it possible to make a custom log with php-fpm where I can add
>> environment variables?
>> I ask this, because I want to add the IP of the user which caused the
>> access/error log.
>>
>> We run a nginx<->php-fpm combination.
>> Previously we had apache2 and that showed us the IP of the users on every
>> access/error line, so we could debug which user caused the Fatal to fix the
>> bug.
>>
>> Anyone has experience with php-fpm to fix this issue?
>>
>> Ali
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "highload-php-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to highload-php-en+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.