location / { index index.jsp; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; deny 192.168.1.1; allow 127.0.0.0/24; allow 123.56.0.0/16; allow 172.16.0.0/16; allow 10.170.0.0/16; deny all; } The above is my location configuration list Note: 1. You must add an IP address when denying , otherwise it will jump directly to 403 without further execution; if the 403 default page is under the same domain name, it will cause an infinite loop of access; 2. Allowed IP segments Arrange from the smallest to the largest segment allowed to be accessed, such as: 127.0.0.0/24 The following can be: 10.170.0.0/16 24 represents the subnet mask: 255.255.255.0 16 represents the subnet mask: 255.255.0.0 8 represents the subnet mask: 255.0.0.0 3. deny all; ending Indicates that all other parameters except the above allow are prohibited The above is all the knowledge points introduced this time. Thank you for your learning and support for 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of rpm installation in mysql
>>: Detailed explanation of the execution process of JavaScript engine V8
Docker has many log plug-ins. The default is to u...
This article example shares the specific code of ...
Request logic Front-end --> Request nginx via ...
This article example shares the specific code of ...
Table of contents Preface Introduction JavaScript...
This article example shares the specific code of ...
I am almost going moldy staying at home due to th...
Table of contents First of all, you need to know ...
Table of contents Preface Scenario Analysis Summa...
What is a sticky footer layout? Our common web pa...
The commands pulled by docker are stored in the /...
inline-flex is the same as inline-block. It is a ...
Table of contents Get the time in the past week G...
Create Table create table table name create table...
Record the installation of two MySQL5.6.35 databa...