【发布时间】:2012-11-02 12:37:53
【问题描述】:
如何正确处理 php 站点的 nginx 配置中所有不存在的位置? 我可以找出 5 种可能的此类位置。
文件不正确:example.com/notexist.jpg
不正确的文件夹:example.com/notexist
嵌套不正确的文件夹:example.com/notexist1/notexist2/..../notexist10000
(3) 和 (1) 的组合:example.com/notexist1/notexist2/..../notexist10000/not.exist.jpg
不存在的 php 文件:example.com/notexist.php
是否有涵盖所有这些情况的微小而强大的解决方案? 还需要避免检查任何文件和目录(使用 -d 和 -f),因为它会增加 CPU 和 IO 开销。
提前致谢!
【问题讨论】:
标签: configuration web nginx