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
1. Connect to MySQL Format: mysql -h host address...
Preface If someone asks you "What are the ch...
1, %: represents any 0 or more characters. It can...
The mobile version of the website should at least...
Every time after installing the system, I have to...
Disable right-click menu <body oncontextmenu=s...
Table of contents MySql8.0 View transaction isola...
Serve: # chkconfig --list List all system service...
Introduction: AD is the abbreviation of Active Di...
Because the docker daemon needs to bind to the ho...
Table of contents 1. Use slots to make components...
This article shares the specific code of Vue2.0 t...
background I want to check the webpack version, b...
How to use CSS to control the arc movement of ele...
1. Introduction to Docker Docker is developed in ...