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
Table of contents Preface Input box component lay...
There is an interview question that requires: a th...
sshd SSH is the abbreviation of Secure Shell, whi...
Table of contents 1. Isolation Level READ UNCOMMI...
Table of contents Preface What situations can cau...
Index definition: It is a separate database struc...
Disable right-click menu <body oncontextmenu=s...
1. I purchased a VPS and CentOS system, and found...
In the process of writing the project page, I enc...
Today I made a menu button. When you move the mous...
1. Problem reproduction: Count the total number o...
This article example shares the specific code of ...
Install the latest stable version of MySQL on Lin...
Implementation Preparation # Need to back up the ...
Table of contents Preface Introduction ngram full...