mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-23 15:31:40 -04:00
Updated Caddyfile (markdown)
parent
d06eea78b4
commit
8702b5154e
@ -34,9 +34,8 @@ mydomain.com:80 {
|
|||||||
redirect / :443 301
|
redirect / :443 301
|
||||||
}
|
}
|
||||||
|
|
||||||
# Curly braces can be on their own line if you prefer
|
# Curly braces must open at the end of a line
|
||||||
mydomain.com:443
|
mydomain.com:443 {
|
||||||
{
|
|
||||||
gzip
|
gzip
|
||||||
ext .html .htm
|
ext .html .htm
|
||||||
tls cert.pem key.pem
|
tls cert.pem key.pem
|
||||||
@ -49,6 +48,4 @@ In the above file, the keywords `redirect`, `gzip`, `ext`, and `tls` are directi
|
|||||||
|
|
||||||
To learn about what directives are available, please see the list of directives in this wiki.
|
To learn about what directives are available, please see the list of directives in this wiki.
|
||||||
|
|
||||||
As you can tell, whitespace separates different arguments/parameters. You can group multiple words into a single argument by enclosing it "in quotes".
|
As you can tell, whitespace separates different arguments/parameters. You can group multiple words into a single argument by enclosing it "in quotes".
|
||||||
|
|
||||||
For those who want to check their understanding: the file above serves `mydomain.com` on ports 80 and 443 (the HTTP and HTTPS ports). All requests to port 80 are redirected to 443, the secure port, with a 301 status code. All requests to port 443 are gzipped. Then, if an extension was not added to the URL, the .html extension will be internally added if the resource exists (and if not, it tries .htm). In other words, it serves clean, extensionless URLs by inferring the file extension. The tls line enables TLS using the certificate and key files listed.
|
|
Loading…
x
Reference in New Issue
Block a user