M
M
Misha Shav2020-10-08 09:10:18
Nginx
Misha Shav, 2020-10-08 09:10:18

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;
}

it is clear that local addresses are marked there, but what does 0 at the end mean?) well, in general, an educational program on geo would be very necessary
Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2020-10-08
@SeanCooper

"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 question

Ask a Question

731 491 924 answers to any question