Welcome! Log In Create A New Profile

Advanced

Problem in $remote_addr when proxying

Tyler Durden
May 18, 2009 10:06AM
Hi,
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 127.0.0.1

In my virtualhost:

upstream my_webcluster {
server 127.0.0.1:8080;
}

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
$proxy_add_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,
Tyler
Subject Author Posted

Problem in $remote_addr when proxying

Tyler Durden May 18, 2009 10:06AM

Re: Problem in $remote_addr when proxying

Igor Sysoev May 20, 2009 08:10AM

Re: Problem in $remote_addr when proxying

lejeczek June 12, 2009 07:19AM

Re: Problem in $remote_addr when proxying

lejeczek June 12, 2009 07:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready