diff --git a/v2:-Config-from-Scratch.md b/v2:-Config-from-Scratch.md deleted file mode 100644 index 2025fe3..0000000 --- a/v2:-Config-from-Scratch.md +++ /dev/null @@ -1,72 +0,0 @@ -An empty config does nothing: - -```json -{} -``` - -This is an empty HTTP server, which responds on port 80 to any host, but with an empty response: - -```json -{ - "apps": { - "http": { - "servers": { - "myserver": { - "listen": [":80"] - } - } - } - } -} -``` - -This is a static file server out of the the `/var/www` directory: - -```json -{ - "apps": { - "http": { - "servers": { - "myserver": { - "listen": [":80"], - "routes": [ - { - "handle": [{ - "handler": "file_server", - "root": "/var/www" - }] - } - ] - } - } - } - } -} -``` - -And this is the same, but with automatic HTTPS (notice that we now serve on the HTTPS port; any port will do, as long as it's not the HTTP port): - -```json -{ - "apps": { - "http": { - "servers": { - "myserver": { - "listen": [":443"], - "routes": [ - { - "match": [{"host": ["example.com"]}], - "handle": [{ - "handler": "file_server", - "root": "/var/www" - }] - } - ] - } - } - } - } -} -``` - -The reason this particular config gets automatic HTTPS is because the host matcher informs Caddy which hostnames to manage certificates for.