遭遇问题:directive “rewrite” is not terminated by “;”
用vi编辑器编辑完nginx.conf文件后生存,,在shell下执行呼吁/usr/local/web/nginx/sbin/nginx -t用以查抄nginx.conf设置文件是否正确(假设nginx被编译到/usr/local/web/nginx/)正确的话:
[[email protected]]# /usr/local/web/nginx/sbin/nginx -tthe configuration file /usr/local/web/nginx/conf/nginx.conf syntax is okconfiguration file /usr/local/web/nginx/conf/nginx.conf test is successful
假如呈现如下问题:directive “rewrite” is not terminated by “;”
[[email protected]]# /usr/local/web/nginx/sbin/nginx -t[emerg]: directive “rewrite” is not terminated by “;” in /usr/local/web/nginx/conf/nginx.conf:160configuration file /usr/local/web/nginx/conf/nginx.conf test failed
处理惩罚要领:将从头后的url用双引号引起来!
堕落:rewrite ^/date/([0-9]{6})/?([0-9]+)?/?$ /index.php?action=article&setdate=$1&page=$2 last;正确:rewrite “^/date/([0-9]{6})/?([0-9]+)?/?$” /index.php?action=article&setdate=$1&page=$2 last;
看着那句directive “rewrite” is not terminated by “;”还觉得是没;呢