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
Table of contents Prepare Five weapons for…in Obj...
Not using lazy loading import Vue from 'vue...
With the popularity and maturity of Docker, it ha...
Table of contents Preface Rendering Example Code ...
Table of contents 1. List interface display examp...
I have read countless my.cnf configurations on th...
I saw a good idea and recorded it. I have used jQ...
In order to make the table fill the screen (the re...
Previously, we all used files with the suffix .ms...
The span tag is often used when making HTML web p...
Let’s not waste any more time and get straight to...
1. Video tag Supports automatic playback in Firef...
Preface The original project was placed on the pu...
1. Unzip MySQL 8.0.16 The dada folder and my.ini ...
Table of contents 1. Component Registration 1.1 G...