server{
if (!-e $request_filename)
{
rewrite ^(.*)$ /index.php last;
}
}
如果if 没有放在location时,在做memc缓存时,在错误日志里会提示以下信息
2014/05/12 10:45:51 [error] 11520#0: *325726 srcache_fetch: cache sent truncated response body while sending to client, client: 192.168.3.124,
server: jiaju.to8to.com, request: "GET /shop/ HTTP/1.1", subrequest: "/index.php", upstream: "fastcgi://127.0.0.1:9000", host: "jiaju.to8to.c
om", referrer: "http://jiaju.to8to.com/shop/"
location / {
try_files $uri $uri/ /index.php?__q=$uri&$args;
}
判断语名一定要放入location的目录里
nginx配置if错误语句时出错一例,布布扣,bubuko.com
原文:http://ruancl.blog.51cto.com/2699729/1411780