Skip to content

Instantly share code, notes, and snippets.

@gibrandev
Last active February 27, 2025 08:25
Show Gist options
  • Save gibrandev/2e6496d9dc4bff4812d497063d4c3843 to your computer and use it in GitHub Desktop.
Save gibrandev/2e6496d9dc4bff4812d497063d4c3843 to your computer and use it in GitHub Desktop.
Caddy file php support
# Global error logging (MUST be at the top)
{
log {
output file /var/log/caddy/error.log
format json
}
}
localhost {
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
# Php
php_fastcgi unix//run/php/php8.1-fpm.sock
# SSL
tls /etc/caddy/keys/cert.pem /etc/caddy/keys/key.pem
log {
output file /var/log/caddy/access.log
format json
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment