getting ip address from fastcgi for Wordpress plugin

Maxim Dounin mdounin at mdounin.ru
Tue Mar 29 12:45:00 MSD 2011


Hello!

On Mon, Mar 28, 2011 at 10:21:31PM -0400, toddlahman wrote:

> I am running a Redhat EL5 server using Nginx 0.8.54 on the frontend,
> with Apache 2.2.3 on the backend and mod_rpaf to forward the IP address
> to be used in filtering spam from Wordpress comments using the Spam Free
> Wordpress plugin. (http://www.toddlahman.com/spam-free-wordpress/)
> 
> I would like to use fastcgi to serve PHP, but I am not aware of any way
> for fastcgi to forward the visitor's IP address like mod_rpaf does for
> Apache for use by my Wordpress plugin.

In fastcgi visitor's ip address is always passed to application 
with appropriate fastcgi params.  Bundled fastcgi_params file have 
them properly set:

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;

Maxim Dounin



More information about the nginx mailing list