nginx中重写rewrite的语法异常[emerg] unknown directive

nginx中重写rewrite的语法错误[emerg] unknown directiveif ( $host ! www.quxiaoshou.com ){rewrite ^

nginx中重写rewrite的语法错误[emerg] unknown directive
if ( $host != 'www.quxiaoshou.com' ){ rewrite ^(.*)$ http://www.quxiaoshou.com$1 permanent; }

?用^代替空格看起来更清晰:

if^(^$host^!=^'www.quxiaoshou.com'^){?