[root@web01 default]# /app/server/nginx/sbin/nginx -tnginx: [emerg] unknown directive "if(!-e" in /app/server/nginx/conf/vhosts/default.conf:11nginx: configuration file /app/server/nginx/conf/nginx.conf test failed[root@web01 default]# grep "if" /app/server/nginx/conf/vhosts/default.conf if(!-e $request_filename) location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$#原因是if 与 () 之间必需要有空格!![root@web01 default]# /app/server/nginx/sbin/nginx -tnginx: the configuration file /app/server/nginx/conf/nginx.conf syntax is oknginx: configuration file /app/server/nginx/conf/nginx.conf test is successful[root@web01 default]# grep "if" /app/server/nginx/conf/vhosts/default.conf if (!-e $request_filename) location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$