From b25215684b4b564564c20706aab3432fbbee1d9b Mon Sep 17 00:00:00 2001 From: zuohuadong Date: Tue, 8 Aug 2017 11:33:42 +0800 Subject: [PATCH] add demo and use caddy example for laravel https://github.com/caddyserver/examples/blob/master/laravel/Caddyfile --- caddy/Caddyfile | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 269b62a1..288d9d3b 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,28 +1,30 @@ # Docs: https://caddyserver.com/docs/caddyfile -0.0.0.0:80 -root /var/www/public -fastcgi / php-fpm:9000 php { - index index.php +0.0.0.0:80 { + root /var/www/public + fastcgi / php-fpm:9000 php { + index index.php + } + + # To handle .html extensions with laravel change ext to + # ext / .html + + rewrite { + to {path} {path}/ /index.php?{query} + } + gzip + browse + log /var/log/caddy/access.log + errors /var/log/caddy/error.log + # Uncomment to enable TLS (HTTPS) + # Change the first list to listen on port 443 when enabling TLS + #tls self_signed + + # To use Lets encrpt tls with a DNS provider uncomment these + # lines and change the provider as required + #tls { + # dns cloudflare + #} } - -# To handle .html extensions with laravel change ext to -# ext / .html - -rewrite { - r .* - ext / - to /index.php?{query} +laradock.demo { + root /var/www/public } -gzip -browse -log /var/log/caddy/access.log -errors /var/log/caddy/error.log -# Uncomment to enable TLS (HTTPS) -# Change the first list to listen on port 443 when enabling TLS -#tls self_signed - -# To use Lets encrpt tls with a DNS provider uncomment these -# lines and change the provider as required -#tls { -# dns cloudflare -#}