We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

nginx question - why have you commented out the try_files in the example blocks?

as subject - I notice that the line

try_files $uri =404;

Is commented out. Why?

thanks :)



98.9k
Accepted
answer

Because if the file does not exist it will produce a 404 not found and we need to rewrite it to the PHP router which will handle it later.

https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files



3.4k

Thank you. Forgive the perhaps silly question but does that protect against the upload attack?



98.9k

I think that is handled later by if (-f $request_filename) {



3.4k

ok I'm confused :) I though If was evil? https://wiki.nginx.org/IfIsEvil



98.9k

It could be evil not always evil

PS: I also like to finish my phrases with :)