1. Introduction Sometimes, after the web platform is online, you need to block a service interface, but you don’t want to go online again. You can use nginx to block the specified platform interface. 2. Specific operations In the server node of the nginx configuration file nginx.conf, add a location. The example is as follows: location /your url { return 403; } Here we take nginx's own nginx.conf as an example to block the root URL path /: Before shielding location / { root html; index index.html index.htm; } The results of accessing the nginx index.html page are as follows: After shielding location / { return 403; root html; index index.html index.htm; } The results of accessing the nginx index.html page are as follows: After modifying the nginx.conf configuration file, you do not need to restart nginx. Instead, run the nginx -s reload command to reload the configuration file and the modified rules will take effect. Additional knowledge: nginx blocks requests from specific http_referer Add to the server configuration item of nginx.conf if ($http_referer ~* "www.xxx.com") { return 403; } The above operation method of nginx blocking the specified interface (URL) is all the content that the editor shares 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:
|
<<: Detailed explanation of the difference between v-model directive and .sync modifier in Vue
>>: Detailed explanation of the installation and configuration process of mysql8.018 on linux
Using c3p0 Import the c3p0jar package <!-- htt...
Effect html <div class="sp-container"...
The crontab command is used by Unix and Linux to ...
Table of contents 1. Introduction 2. Installation...
Background <br />Students who work on the fr...
Table of contents 1. Analysis of MySQL architectu...
Table of contents Preface Installation and Usage ...
<br />When you click the link, the web page ...
In the process of writing HTML, we often define mu...
Table of contents 1. What is JavaScript? 2. What ...
Before the arrow was shot, the bow whispered to t...
Table of contents Preface Introduction-Official E...
This article uses a specific example to introduce...
Table of contents Overview Build Process Related ...
Install TomCat on Windows This article will intro...