nginx server nginx is an excellent web server that is very efficient in processing static files. At the same time, its proxy forwarding function is also very simple and efficient when combined with other background servers. location We know that nginx will parse the request and then get information about the requested URL. We only need to match the URL and then intercept it. Matching rules location / { if ($request_uri ~* ^/\?http(.*)$) { return 404; } } After such matching, we can intercept all requests to the root directory URL and the parameter is ?httpxxx. Similar requests will display 404. Anti-hotlink Returns the http code, for example, to set up nginx anti-hotlinking: location ~* \.(gif|jpg|png|swf|flv)$ { valid_referers none blocked www.80shihua.com www.menghuiguli.com; if ($invalid_referer) { return 404; } } nginx common variables nginx parses out many variables that we commonly use. We just need to use them. The following are the commonly used variables of nginx. For specific usage, please refer to the official documentation.
Summarize This is the end of this article on how to use nginx to intercept specified URL requests through regular expressions. For more relevant content about nginx intercepting specified URL requests through regular expressions, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue3+script setup+ts+Vite+Volar project
>>: How to completely delete the MySQL 8.0 service under Linux
The server reports an error 502 when synchronizin...
Scary, isn't it! Translation in the picture: ...
Table of contents 1. Prototype chain inheritance ...
This article shares the specific code of jQuery t...
Table of contents Canvas related documents Effect...
This article shares the MySQL precompilation func...
Table of contents Preface text 1. Global Registra...
Table of contents Introduction to Samba Server Sa...
Docker version 1.13.1 Problem Process A MySQL con...
<br />This web page production skills tutori...
1. nohup Run the program in a way that ignores th...
MySQL supports nested transactions, but not many ...
environment: 1. Windows Server 2016 Datacenter 64...
1. Overview Zabbix is a very powerful and most ...
Table of contents background Problem Analysis 1. ...