NGINX如果-e为try_files

我已经读了陷阱和IfIsEvil ,现在想尝试没有ifs我的完整的nginxconfiguration。

但是我无法转换这个额外的PHP规则:

if (!-e $request_filename){ rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last; } 

有人能帮助我吗? =(。

祝你今天愉快,

巴斯蒂安

您可以使用

 try_files $uri @rewrite_location location @rewrite_location { .... your rewrite here }