Nginx is a powerful, high-performance web and reverse proxy server with many excellent features: 1. Nginx request limit
2. Connection and request of HTTP protocol1. The concept of HTTP protocol connection and request
2. Illustration of HTTP protocol connection and request 3. The relationship between HTTP protocol connection and request versions
3. Configuration syntax of Nginx connection limit1. Configuration syntax of limit_conn_zone
2. Configuration syntax of limit_conn
4. Configuration syntax of Nginx request restriction1. Configuration syntax of limit_req_zone
2. Configuration syntax of limit_req
5. Configuration demonstration of Nginx request restriction1. First create a submodule.html page and upload it to the /opt/app/html directory, so that you can configure the sub_module module compilation parameters and then access the submodule.html page in the /opt/app/html directory to view the replaced content. submodule.html page <html> <head> <meta charset="utf-8"> <title>submodule</title> </head> <body> <a>html</a></br> <a>xml</a></br> <a>json</a></br> <a>xml</a></br> <a>jsp</a></br> <a>html</a> </body> </html> Browser access is as follows 2. Edit the nginx.conf configuration file [root@localhost /]# vim /etc/nginx/nginx.conf 3. Add the following configuration in the http block #$binary_remote_addr represents the client's address; #zone=req_zone indicates the storage space name for requests initiated by the same client address #1r/s indicates once per second limit_req_zone $binary_remote_addr zone=req_zone:1m rate=1r/s; 4. Add the following configuration to the location block of the http block #Configuration of nginx connection request limit location / { root /opt/app/html; limit_req zone=req_zone; } 5. Check whether the modified configuration file is correct. If the message "successful" is returned, it means that the configuration file has been modified correctly. Otherwise check the configuration file syntax. 6. Reload the configuration file [root@localhost /]# systemctl reload nginx 7. Use the ab stress testing tool to make concurrent requests For the installation of ab stress testing tool, please refer to this blog post link: https://wwwxz.blog.csdn.net/article/details/118584751 #-n indicates the number of requests initiated, -c indicates the number of concurrent requests [root@localhost ~]# ab -n 20 -c 10 http://localhost/submodule.html This is the end of this article about how to configure nginx request limit. For more information about nginx request limit, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of MySQL foreign key constraints and table relationships
>>: Implementing a table scrolling carousel effect through CSS animation
Table of contents 1. Create a Hadoop directory in...
introduction Let's start with our content. I ...
Table of contents Preface 1. The significance of ...
Let's briefly sort out the configuration of s...
System version [root@ ~]# cat /etc/redhat-release...
In the previous article, you have installed Docke...
The installation and configuration method of MySQ...
1. Background Sysbench is a stress testing tool t...
1 CSS style without semicolon ";" 2 Tags...
3 ways to implement tab switching in Vue 1. v-sho...
1. Introduction to gitlab Gitlab official address...
Since I returned the Mac, my original laptop has ...
Design the web page shown above: <!DOCTYPE htm...
In ordinary projects, I often encounter this prob...
Table of contents Requirement Description Problem...