caddy-website/new/includes/examples/file-server.md
2023-12-08 18:49:07 -05:00

1.9 KiB

example.com

root * /var/www

# Serve precompressed files if present
file_server /downloads/* {
	precompressed gzip zstd br
}

# Compress everything else that would benefit
encode zstd gzip

# Static site using database as file system
file_server /database/* {
	fs sqlite data.sql 
}

# Static site embedded within the Caddy binary
file_server /embedded/* {
	fs embedded
}

# (Range/Etag/etc. all work without extra config)

# Serve static site with directory listings
file_server browse