mirror of
https://github.com/caddyserver/website.git
synced 2025-04-24 14:06:17 -04:00
docs: Add Caddyfile syntax highlighting (#41)
This commit is contained in:
parent
75fcfc21bb
commit
e0f5ee1bb9
34 changed files with 215 additions and 179 deletions
|
@ -8,7 +8,7 @@ Create a new text file named `Caddyfile` (no extension).
|
|||
|
||||
The first thing to type in a Caddyfile is your site's address:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
```
|
||||
|
||||
|
@ -18,7 +18,7 @@ localhost
|
|||
|
||||
Then hit enter and type what you want it to do, so it looks like this:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
|
||||
respond "Hello, world!"
|
||||
|
@ -43,7 +43,7 @@ Hello, world!</code></pre>
|
|||
|
||||
You can define multiple sites in a Caddyfile by wrapping them in curly braces `{ }`. Change your Caddyfile to be:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost {
|
||||
respond "Hello, world!"
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ This is the most common way to get HTTPS.
|
|||
|
||||
Create a file called `Caddyfile` (no extension) where the first line is your domain name, for example:
|
||||
|
||||
```
|
||||
```caddy
|
||||
example.com
|
||||
|
||||
respond "Hello, privacy!"
|
||||
|
|
|
@ -36,7 +36,7 @@ Then make a request to [localhost](https://localhost) (or whatever address you s
|
|||
|
||||
In the current working directory, create a file called `Caddyfile` with these contents:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
|
||||
reverse_proxy 127.0.0.1:9000
|
||||
|
@ -50,7 +50,7 @@ You can then make a request to [https://localhost](https://localhost) to see it
|
|||
|
||||
It's easy to change the proxy's address:
|
||||
|
||||
```
|
||||
```caddy
|
||||
:2016
|
||||
|
||||
reverse_proxy 127.0.0.1:9000
|
||||
|
|
|
@ -41,7 +41,7 @@ You can use another folder as the site root:
|
|||
|
||||
In the root of your site, create a file called `Caddyfile` with these contents:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
|
||||
file_server
|
||||
|
@ -59,7 +59,7 @@ The [`file_server` directive](/docs/caddyfile/directives/file_server) has more o
|
|||
|
||||
If you don't have an index file but you want to display a file listing, use the `browse` argument:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
|
||||
file_server browse
|
||||
|
@ -67,7 +67,7 @@ file_server browse
|
|||
|
||||
You can also use another folder as the site root:
|
||||
|
||||
```
|
||||
```caddy
|
||||
localhost
|
||||
|
||||
root * /home/me/mysite
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue