Caddy equivalent code
domain.tld www.domain.tld {
# Set this path to your site's directory:
root * /var/www/project/public
# Enable Gzip compression:
encode gzip
# Serve PHP files through php-fpm:
php_fastcgi unix//run/php/php7.4-fpm.sock
# Enable the static file server:
file_server
# Enable HTTP request logging
log {
output file /var/log/caddy/access.log
}
}
Depending on your PHP-FPM config, the
php_fastcgi
can also bephp_fastcgi 127.0.0.1:9000
.
Suggestions for improvement to code or comments? What about the placement of the log directive?
The NginX code has error logging. Where does that happen for Caddy? In the Caddy process log? If so, do I need to include a global section in the Caddy code and reference the process log?