Problem in $remote_addr when proxying

Tyler Durden tylersticky at
Mon May 18 18:06:00 MSD 2009

I have nginx as frontend for serving static files and a proxy to
apache for dinamic request.
The problem is on the $remote_addr that arrive to apache as

In my virtualhost:

upstream my_webcluster {

server {
    location  / {
        proxy_pass  http://my_webcluster;
        include     /etc/nginx/proxy.conf;

in /etc/nginx/proxy.conf:

proxy_redirect              off;
proxy_set_header            Host              $http_host;
proxy_set_header            X-Real-IP         $remote_addr;
proxy_set_header            X-Forwarded-For
client_max_body_size        10m;
client_body_buffer_size     128k;
proxy_connect_timeout       90;
proxy_send_timeout          90;
proxy_read_timeout          90;
proxy_buffer_size           4k;
proxy_buffers               4 32k;
proxy_busy_buffers_size     64k;
proxy_temp_file_write_size  64k;

What I'm doing wrong here?

Thanks in advance,

More information about the nginx mailing list