mirror of
https://git.freebsd.org/ports.git
synced 2025-05-15 16:51:52 -04:00
Thanks to work by scf, the caddy rc(8) script has been completely rewritten and substantially improved, though this necessitated changing all runtime locations. Most importantly: - The runtime log now lives in /var/log/caddy/ instead of /var/log, so that the logdir can be null-mounted - Automatic SSL certs are now stored in /var/db/caddy/data/caddy, instead of /root/.local/share/caddy Caddy uses freedesktop.org's XDG base dir specification, which conflicts quite spectacularly with FreeBSD's hier(7). The most sensible thing to do was to put the runtime data stores into /var/db/caddy, though XDG needs XDG_DATA_HOME and XDG_CONFIG_HOME to be separate dirs and caddy will create a .../caddy subdir in each of them.
41 lines
1.1 KiB
Text
41 lines
1.1 KiB
Text
# The Caddyfile is an easy way to configure your Caddy web server.
|
|
#
|
|
# To use your own domain name (with automatic HTTPS), first make
|
|
# sure your domain's A/AAAA DNS records are properly pointed to
|
|
# this machine's public IP, then replace the line below with your
|
|
# domain name.
|
|
|
|
# Unless the file starts with a global options block, the first
|
|
# uncommented line is always the address of your site.
|
|
#
|
|
localhost {
|
|
# Set this path to your site's directory:
|
|
root * %%WWWDIR%%
|
|
|
|
# Enable the static file server:
|
|
file_server
|
|
|
|
# Set up a reverse proxy:
|
|
# reverse_proxy localhost:8080
|
|
|
|
# Serve a PHP site through php-fpm:
|
|
# php_fastcgi localhost:9000
|
|
|
|
# Enable logging:
|
|
log {
|
|
output file /var/log/caddy/access.log
|
|
# Caddy's structured log format:
|
|
format json
|
|
# Or, for Common Log Format:
|
|
# format single_field common_log
|
|
}
|
|
}
|
|
|
|
# Caddy will automatically obtain ACME certs for domains
|
|
# example.com {
|
|
# root * /path/to/example.com
|
|
# file_server
|
|
# }
|
|
|
|
# Refer to the Caddy docs for more information:
|
|
# https://caddyserver.com/docs/caddyfile
|