Welcome! Log In Create A New Profile

Advanced

Re: 'real_ip_header proxy_protocol' don't change the client address

Maxim Dounin
September 28, 2017 10:18AM
Hello!

On Thu, Sep 28, 2017 at 04:54:41PM +0300, Maxim Dounin wrote:

> Hello!
>
> On Wed, Sep 27, 2017 at 10:38:45PM -0400, fengx wrote:
>
> > The config is rather simple as following. My test version is 1.7.2, a bit
> > old. I can't upgrade to the latest one in our production for now. Anyway I
> > think it should work in 1.7.2 because the document says proxy_protocol was
> > introduced from 1.5.12.
> >
> > http {
> > log_format combined '$proxy_protocol_addr - $remote_addr - $remote_user
> > [$time_local] '
> > '"$request" $status $body_bytes_sent '
> > '"$http_referer" "$http_user_agent"';
> > ...
> >
> > server {
> > server_name www.abc.com;
> >
> > listen 80;
> > listen 8181 proxy_protocol;
> >
> > real_ip_header proxy_protocol;
> > real_ip_recursive on;
> > set_real_ip_from 192.168.1.0/24;
> >
> > location / {
> > ...
> > }
> > }
> > }
>
> And how do you test?
>
> Exactly the same config, and even with exctly the same version of
> nginx works fine here:

Uhm, and one more note: exactly the same configuration will
produce the following error:

nginx: [emerg] duplicate "log_format" name "combined" in ...

It might be the reason why you are seeing incorrect address: you
are testing with some different configuration instead.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

'real_ip_header proxy_protocol' don't change the client address

fengx September 26, 2017 06:56AM

Re: 'real_ip_header proxy_protocol' don't change the client address

fengx September 26, 2017 07:02AM

Re: 'real_ip_header proxy_protocol' don't change the client address

Maxim Dounin September 26, 2017 09:58AM

Re: 'real_ip_header proxy_protocol' don't change the client address

fengx September 27, 2017 10:38PM

Re: 'real_ip_header proxy_protocol' don't change the client address

Maxim Dounin September 28, 2017 09:56AM

Re: 'real_ip_header proxy_protocol' don't change the client address

Maxim Dounin September 28, 2017 10:18AM

Re: 'real_ip_header proxy_protocol' don't change the client address

fengx October 23, 2017 02:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready