1. Caddy version (caddy version
):
2.2.2
2. How I run Caddy:
As a systemd service
a. System environment:
Debian 10 (Buster)
b. Command:
N/A
c. Service/unit/compose file:
Systems default config
d. My complete Caddyfile or JSON config:
The main Caddyfile only contains import vhosts/*
, and my email address for LetsEncrypt, each vhost is inside a single config file.
Here’s the concerned vhost:
jdr.pierstoval.com {
root * /var/www/jdr.pierstoval.com/www/
encode gzip
file_server
php_fastcgi /esteren/* unix//run/php/php7.74-fpm.sock
tls pierstoval@gmail.com
log {
output file /var/www/jdr.pierstoval.com/access.log {
roll_size 512mb
roll_keep_for 720h
}
}
}
3. The problem I’m having:
I’m migrating a PHP application which web entrypoint is hosted in a subdirectory.
It was previously hosted with Apache2, here’s the vhost:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin pierstoval+jdr.pierstoval.com@gmail.com
ServerName jdr.pierstoval.com
DocumentRoot /var/www/jdr.pierstoval.com/www
Include /etc/apache2/conf-available/php7.3-fpm.conf
<Directory /var/www/jdr.pierstoval.com/www>
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/www/jdr.pierstoval.com/error.log
LogLevel warn
CustomLog /var/www/jdr.pierstoval.com/access.log combined
ServerSignature Off
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/pierstoval.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/pierstoval.com/privkey.pem
</VirtualHost>
</IfModule>
It is important to note that the /var/www/jdr.pierstoval.com/www/esteren
directory is a symlink to /var/www/jdr.pierstoval/esteren/webroot/
.
The project is open-source and its source code is in the links below.
4. Error messages and/or full log output:
When I go to Corahn Rin - Accueil (the home page of the project), it works but there are several PHP errors that indicate that some files have not been loaded (especially the config.php
file that is in the project directory).
It seems that when I make a request on a non-existent file (such as Corahn Rin - Accueil, the homepage in French), Caddy doesn’t proxy the entire request to FastCGI, or maybe it’s proxied improperly. I could not find a way to debug this part
5. What I already tried:
I tried copy/pasting the php_fastcgi expanded form but as I’m a total newcomer to Caddy, I’m not sure of what I should modify, how, where, etc.
I also tried to debug the PHP entrypoint file (the index.php file), but it’s not even called…
6. Links to relevant resources:
Project’s source code: GitHub - StudioAgate/CorahnRinV1: Character generator for Shadows of Esteren / Les Ombres d'Esteren.