From aaf0e4ccf4f7e665bb9c75329bdec8e0cb5f8ea3 Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Wed, 13 Nov 2019 12:54:09 -0700 Subject: [PATCH] Updated v2: Caddyfile examples (markdown) --- v2:-Caddyfile-examples.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/v2:-Caddyfile-examples.md b/v2:-Caddyfile-examples.md index 700c096..79f3801 100644 --- a/v2:-Caddyfile-examples.md +++ b/v2:-Caddyfile-examples.md @@ -1,11 +1,13 @@ # Caddyfile configuration examples -Caddyfile configuration is easy and convenient and Caddy v2 configuration has changed a little, but for the better. Hence, below there are some configuration examples for common use cases. +Caddyfile configuration is easy and convenient, and is recommended for most manual workflows. -Feel free to add your Caddyfile configuration, too. +Overall, the v2 Caddyfile is actually the same as the old v1 Caddyfile, but some directives and their syntax have changed. We've also made significant improvements to request matching and setting global options. A guide for transitioning from v1 to v2 is coming soon. ## Simple local static fileserver with php support + Configuring Caddy as a simple and local static HTTP fileserver that can also run PHP can look like this: + ``` :8080 @@ -14,6 +16,7 @@ encode gzip php_fastcgi php-fpm:9000 file_server ``` + The converted equivalant (`caddy adapt --config /path/to/Caddyfile --pretty`) in JSON looks like this: ``` @@ -101,6 +104,7 @@ The converted equivalant (`caddy adapt --config /path/to/Caddyfile --pretty`) in ``` ## Simple FQDN static fileserver with php support and automatic HTTPS + Configuring Caddy as a simple and FQDN static HTTP fileserver that can also run PHP with automatic HTTPS can look like this: ``` yourdomain.com, www.yourdomain.com