1. Caddy version (caddy version
):
Caddy 2.4.5 with replace_response and format plugins
2. How I run Caddy:
Windows service
a. System environment:
Windows Server 2019
b. Command:
nssm start caddy, with command line:
caddy run
c. Service/unit/compose file:
n/a
d. My complete Caddyfile or JSON config:
flextype.cassland.org {
root * ..\Flextype
php_fastcgi {
to localhost:9001
to localhost:9002
to localhost:9003
to localhost:9004
to localhost:9005
to localhost:9006
to localhost:9007
to localhost:9008
}
file_server
log {
output file .\Logs\TESTaccess.log
format formatted
}
}
3. The problem I’m having:
I am trying to test a CMS called Flextype. The installation instructions are as thin as “upload to your host which supports PHP7.4”. I therefore have to assume that some “standard” is followed which enables a PHP site to work on some default system. I further assume that Caddy’s php_fastcgi directive does what is normally expected, not least because I have some long-running sites where this works (and other test sites where sometimes it doesn’t!).
I can go to the root of the flextype site using “https://flextype.mydomain/” and get the “successfully installed” message. But when I try to go to a subpage such as “https://flextype.mydomain/admin” I simply get back 502. Also the favicon request “https://flextype.mydomain/favicon.ico” results in 502 rather than the 404 I’d expect.
4. Error messages and/or full log output:
502
I do not know where to find any information which might explain why I am getting a 502. The Caddy access log contains no other information. The php-errors log, for instance, has no record of this at all (it appears only to contain errors pertaining to exif data in images!)
5. What I already tried:
I’ve tried decomposing the php_fastcgi command and using a number of different try_files formats that I have seen recommended for other similar systems, but that seems too random an approach.
I have read around the forum messages about PHP and 502 errors, but none help (they are largely about Caddy v1 or v2 betas, anyway).
I’m pretty sure my problems would just go away if I simply changed to Apache, or maybe running Caddy on Linux, either of which I could do. But I’d like to persist in trying to find a solution to reliable PHP in Caddy on Windows, because I try to fight the general perception that Windows shouldn’t be taken seriously for web serving.
I’d be happy to do more diagnosis if I had some suggestions where to look.
6. Links to relevant resources:
Their certificate expired today (!), so not all browsers will let you view it… More useful today is: