1. My Caddy version (caddy -version
):
v2.0 beta 6
2. How I run Caddy:
$ sudo ./caddy2_beta6_linux_amd64 start --adapter caddyfile --config /mnt/vagrant/Caddyfile
I run caddy by manually starting it and loading/adapting a caddyfile. I created certificates for my local machine using mkcert and import them in the caddyfile.
a. System environment:
I’m running Caddy on a relatively clean Vagrant box running Ubuntu 18.04.
b. Command:
$ sudo ./caddy2_beta6_linux_amd64 start --adapter caddyfile --config /mnt/vagrant/Caddyfile
d. My complete Caddyfile:
caddy2.test:443 {
root * /var/www/caddy2/web
tls /etc/ssl/bcaddy2.test.crt /etc/ssl/caddy2.test.key
php_fastcgi unix:/var/run/php/php7.2-fpm.sock
}
3. The problem I’m having:
The problem I’m having is that the Caddyfile adapter in Caddy 2 does not seem to allow unix sockets as the PHP Fastcgi upstream.
I thought I’d ask for help here before creating an Issue on Github.
4. Error messages and/or full log output:
Caddy 2 beta 6 starts correctly:
2019/10/16 10:44:41 Caddy 2 admin endpoint listening on localhost:2019
2019/10/16 10:44:41 [INFO][cache:0xc0001f88c0] Started certificate maintenance routine
2019/10/16 10:44:41 [WARNING] Stapling OCSP: no OCSP stapling for [caddy2.test]: no OCSP server specified in certificate
2019/10/16 10:44:41 [INFO] tls: Cleaned up storage unit(s)
2019/10/16 10:44:41 [INFO][caddy2.test] Skipping automatic certificate management because one or more matching certificates are already loaded
2019/10/16 10:44:41 [INFO] Enabling automatic TLS certificate management for []
2019/10/16 10:44:41 [INFO] Enabling automatic HTTP->HTTPS redirects for [caddy2.test]
2019/10/16 10:44:41 Caddy 2 serving initial configuration
Successfully started Caddy (pid=1703)
When calling the website in my browser Caddy returns a 500 error and logs the following:
2019/10/16 10:53:09 [ERROR] [GET /index.php] making dial info: upstream unix:/var/run/php/php7.2-fpm.sock: invalid dial address unix:/var/run/php/php7.2-fpm.sock: address var/run/php/php7.2-fpm.sock: missing port in address
Of course I could set my fastcgi to listen on a TCP/IP socket, but since the webserver and fastcgi run on the same machine I’d prefer to use a unix socket.
I’d like to use the Caddyfile adapter in production as well to make sure the configuration is automatically loaded when starting/restarting/recovering from a crash.
Am I doing something wrong, or is this simply not implemented in Caddy 2 or the Caddyfile adapter (yet)?