Original configuration: http { ...... limit_conn_zone $binary_remote_addr zone=one:10m; limit_req_zone $binary_remote_addr zone=fifa:10m rate=5r/s; ...... server { ...... limit_conn one 5; limit_req zone=fifa burst=100; ...... }} Whitelist configuration: http { ...... geo$whiteiplist { default 1; 127.0.0.1 0; 10.10.0.0/24 0; } map $whiteiplist $limit { 1 $binary_remote_addr; 0 ""; } limit_conn_zone $limit zone=one:10m; limit_req_zone $limit zone=fifa:10m rate=5r/s; ...... server { ...... limit_conn one 5; limit_req zone=fifa burst=100; ...... }} illustrate: The geo directive defines a whitelist $whiteiplist, the default value is 1, and all are restricted. If the client IP matches the IP listed in the whitelist, the $whiteiplist value is 0, which means no restriction. The map instruction maps the $whiteiplist value to 1, that is, the restricted IP, to the client IP. Map the $whiteiplist value of 0, that is, the whitelist IP, to an empty string. Limit_conn_zone and limit_req_zone directives with empty keys will be ignored, so there is no limit on the listed IPs. The above example of Nginx setting whitelist through geo module is all I want to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JS realizes simple picture carousel effect
>>: Mysql solution to improve the efficiency of copying large data tables
1. Introduction Today a colleague asked me how to...
Table of contents 1. What is Docker Compose and h...
Today I will share with you a good-looking counte...
First look at the effect: html <a href="#...
This article shares with you a detailed tutorial ...
When we want to add a shadow to a rectangle or ot...
Table of contents 1. The difference between trans...
Table of contents Preface No.1 A focus No.2 Extra...
Table of contents 1. Data Source 2. Overall ranki...
Main library execution CREATE DATABASE test CHARA...
Table of contents background How does element-ui&...
It mainly shows how to configure X-Frame-Options,...
This article records some major setting changes w...
Table of contents mysql permission control Permis...
First check the /etc/group file: [root@localhost ...