Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Harmonic's avatar

Reason nginx config allows all .php files?

Noticed in my error logs that any time a .php file was requested that doesn't exist, it was logging an error rather than going to a 404 page.

It seems that by default Forge allows all .php requests. Adding a

try_files $uri /index.php =404;

fixes the issue, but I'm wondering if there is a reason forge allows this by default? And if there is a better fix that doesn't involve adding this to server/location context in nginx.conf.

0 likes
0 replies

Please or to participate in this conversation.