Related to:
one weird thing I noticed with caddy and PHP is that when specifying a non-existant file (aka a 404 link), instead of the normal 404 page it throws an “No input file specified.”
is there a way to fix that, so that caddy essentially doesnt try anything with PHP but just does the 404?
When an non existent php file is requested, although a 404 is sent back to the requester, a Primary script unknown
error is also thrown in the error log and the custom 404 file is also not served. That custom file is however correctly served for any other non-existent file with a extension different from .php
Config file:
example.com {
fastcgi / /var/run/php/php7.0-fpm.sock php {
index index.php login.php
}
errors /var/log/caddy/error.log {
404 /var/www/err_img/404.html
}
index index.php
root /var/www
}
matt
(Matt Holt)
February 4, 2018, 6:29pm
2
@abiosoft - What do you think, is this what we expect? I honestly haven’t used PHP in so long I can’t even remember.
abiosoft
(Abiola Ibrahim)
February 5, 2018, 8:40am
3
That is not expected, I will dig more into this.
abiosoft
(Abiola Ibrahim)
February 5, 2018, 9:40am
4
The reason is that fastcgi server responds with a body and Caddy prioritises the upstream response over writing another response.
Maybe we should make it user configurable for Caddy to override fastcgi upstream response body when the response code is > 400
.
matt
(Matt Holt)
February 5, 2018, 3:47pm
5
Thanks for looking into it!
That seems like a good idea. If I recall correctly, that is how it is done on other servers too.
magikstm
(Magikstm)
February 5, 2018, 9:22pm
6
1 Like
abiosoft
(Abiola Ibrahim)
February 6, 2018, 3:16pm
7
No, that is another issue. Not related.
By the way, thanks for bringing that up. I’ve forgotten about that pull request and it needs my review.
1 Like
system
(system)
Closed
May 7, 2018, 3:16pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.