IP address of fastcgi server?

Ian Hobson ian at ianhobson.co.uk
Tue Oct 12 22:59:49 MSD 2010


On 12/10/2010 02:41, Ilan Berkner wrote:
> Hi All,
>
> We're doing some profiling and one of the parameters we'd like to get is
> the IP address of the fastcgi (in this case php-fpm) server that
> processed the request.  PHP $_SERVER['server_addr'] returns the external
> address of the nginx server per our fastcgi configuration:
>
> fastcgi_param  SERVER_ADDR        $server_addr;
>
> Is this correct behavior? is there a way to get the local address of the
> server processing the php request?
>
You can obtain the IP address of the machine running the script with

$_server['SERVER_ADDR']

Regards

Ian



More information about the nginx mailing list