Answer the question
In order to leave comments, you need to log in
How does the geo module in nginx work?
Good afternoon! I started to study web servers, in particular nginx, I look at different settings and configs, but I didn’t understand the geo module, incl. according to official documentation. I saw this setting on one web server
geo $nonlocal_addr {
default 1;
192.168.0.0/16 0;
172.16.0.0/12 0;
10.0.0.0/8 0;
}
Answer the question
In order to leave comments, you need to log in
"Zero at the end" means the value of the variable, which is assigned if the IP address falls into the appropriate range. By default (if it does not hit) - one. This is how geo works.
I don’t even know what else to offer you besides documentation - it seems to be quite exhaustive ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question