This module provides a simple Host-Based Access Control.
The ngx_http_access_module module makes it possible to control specific IP clients. Rule checks are performed in the first matching order.
_ Configuration example __:
Location/{: deny 192.168.1.1;: Allow 192.168.1.0/24;: Allow 10.1.1.0/16;: deny all ;}
In the preceding example, only IP addresses except 192.168.1.1 are allowed to access the network segments 10.1.1.0/16 and 192.168.1.0/24.
When executing many rules, it is best to use the ngx_http_geo_module module.
Allow
Syntax: Allow [Address | CIDR | all]
Default: No
Context: HTTP, server, location, limit_0000t
The network address described above has the right to directly access
Disable
Syntax: deny [Address | CIDR | all]
Default: No
Context: HTTP, server, location, limit_0000t
The network address described above denies access.
References
Original documentation: http://sysoev.ru/nginx/docs/http/ngx_http_access_module.html