Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

set_real_ip_from and scoping

$
0
0
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?

Viewing all articles
Browse latest Browse all 972

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>