Welcome! Log In Create A New Profile

Advanced

set_real_ip_from and scoping

Posted by ballistyx 
set_real_ip_from and scoping
July 17, 2015 04:41PM
I'm in the process of upgrading from an old 1.2 version of NGINX to 1.8. However, I'm having some issues with scoping rules and set_real_ip_from. Basically I have my global config in the http scope that defines some IP masks and then I have additional server level config files that are included and only have server scoped items.

In my setup, I have this type of config:

events{...}
http
{
...
set_real_ip_from IP1/XX
set_real_ip_from IP2/XX
...
set_real_ip_from IPN/XX

...

include ~/sites/*.conf

...
}

conf files in sites look as such:

server
{
...
set_real_ip_from IP1/XX
set_real_ip_from IP2/XX
...
set_real_ip_from IPN/XX
...
}

What I see happening is that the directives in http completely override away the directives in the server (or they are ignored). I haven't found clear documentation on which scope is considered to be the ultimate config or if I need to do things differently. Does HTTP blow away server or is it the other way around? Also I'm finding that the scoping rules may have changed somewhere between the two versions that I'm working with. Can anyone point me to the proper documentation on scoping options and is there a way that i can possibly merge these rules on either on a per site basis or just have my server rules merged in with the http ones without having to move them into my nginx.conf?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
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