Detailed instructions related to NginxRewrite rules

Nginx Rewrite rule-related instructions Relevant instructions include if, rewrite, set, return, break, etc., the most critical of which is rewrite. A simple Nginx The syntax of the Rewrite rule is as follows: rewrite ^/b/(.*)\.html /play.php?video=$1 break; 1.break command Default value: none ; Environment: server, location, if ; The function of this instruction is to complete the current rule set and no longer process the rewrite instruction. 2.if instruction Default value: none; Use environment: server, location This instruction is used to check whether a condition is met, and if the condition is met, execute the statement inside the braces. The If instruction does not support nesting, and does not support multiple conditions && and || processing. A. Variable name, the wrong value includes: empty string “” or any string starting with 0 B. Variable comparison can use “=” (meaning equal) and “!=” (meaning not equal) C. Regular expression pattern matching can use “~*” and “~” symbols D. The “~” symbol indicates a case-sensitive match E. The “~*” symbol indicates a case-insensitive match F. The functions of “!~” and “!~*” symbols are just opposite to those of “~” and “~*”, indicating that they do not match G. “-f” and “!-f” are used…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索