mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
Updated v2: Caddyfile examples (markdown)
parent
827c7ef458
commit
aaf0e4ccf4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user