try_files
参考:https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
Use the try_files directive to filter out the problem condition:
location ~* .php$ {
try_files $uri =404;
fastcgi_pass backend;
# [...]
}
sendfile
有关视频的配置
https://segmentfault.com/q/1010000003055006/a-1020000003064578
location /video/ {
sendfile on;
sendfile_max_chunk 256k;
aio threads;
directio 512k;
output_buffers 1 128k;
}