某草草2017-05-16 17:17:30
server {
index index.html index.php;
location / {
try_files $uri $uri/ $uri.html $uri.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
# add fastcgi_pass line here, depending if you use socket or port
}
}
核心是 try_files
指令的使用, 你可以参考NGINX的文档