caddy-website/src/docs/markdown/caddyfile/options.md

48 lines
2.2 KiB
Markdown
Raw Normal View History

2020-01-24 12:47:52 -07:00
---
title: Global options (Caddyfile)
---
# Global options
The Caddyfile has a way for you to specify options that apply globally. Some options act as default values, while others customize the behavior of the Caddyfile [adapter](/docs/config-adapters).
The very top of your Caddyfile can be a **global options block**. This is a block that has no keys:
```
{
...
}
```
There can only be one at most, and it must be the first block of the Caddyfile.
Possible options are:
```
{
http_port <port>
https_port <port>
order <dir1> first|last|[before|after <dir2>]
storage <module_name> {
<options...>
}
experimental_http3
acme_ca <directory_url>
2020-02-28 11:16:45 -07:00
acme_ca_root <pem_file>
2020-01-24 12:47:52 -07:00
email <yours>
2020-02-28 11:16:45 -07:00
admin off|<addr>
debug
2020-01-24 12:47:52 -07:00
}
```
- **http_port** is the port for the server to use for HTTP. For internal use only; does not change the HTTP port for clients. Default: 80
- **https_port** is the port for the server to use for HTTPS. For internal use only; does not change the HTTPS port for clients. Default: 443
- **order** sets or changes the standard order of HTTP handler directive(s). Can set directives to be `first` or `last`, or `before` or `after` another directive.
- **storage** configures Caddy's storage mechanism. Default: `file_system`
- **experimental_http3** enables experimental draft HTTP/3 support. Note that HTTP/3 is not a finished spec and client support is extremely limited. This option will go away in the future. _This option is not subject to compatibility promises._
- **acme_ca** specifies the URL to the ACME CA's directory. It is strongly recommended to set this to Let's Encrypt's [staging endpoint](https://letsencrypt.org/docs/staging-environment/) for testing or development. Default: Let's Encrypt's production endpoint.
2020-02-28 11:16:45 -07:00
- **acme_ca_root** specifies a PEM file that contains a trusted root certificate for ACME CA endpoints, if not in the system trust store.
2020-01-24 12:47:52 -07:00
- **email** is your email address. Mainly used when creating an ACME account with your CA, and is highly recommended in case there are problems with your certificates.
2020-02-28 11:16:45 -07:00
- **admin** customizes the [admin API endpoint](/docs/api). If `off`, then the admin endpoint will be disabled.
- **debug** enables debug mode, which sets all log levels to debug (unless otherwise specified).