nginx 的 if 语法好严格呀!

今天被机房通知删网站内容,我发转给相应的同事了。然后我自己就在 nginx 里折腾看能不能先把那个网址改成 403。试了半天,发现 nginx.conf 里用 if 指令判断 querystring 里的内容的时候,等号前后都得有空格,像这样:
if ( $arg_uid = 877363 ) { return 403;}
如果没有空格就不行,看着像是 nginx 不知道那个变量名和操作符号有多长,需要用空格来分隔的意思。

This entry was posted in 默认分类 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.