docs: General 2.6 updates

This commit is contained in:
Matthew Holt 2022-09-16 17:03:41 -06:00
parent a87295bf0b
commit c429966513
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
4 changed files with 13 additions and 5 deletions

View file

@ -115,6 +115,7 @@ vars
root
header
copy_response_headers # only in reverse_proxy's handle_response block
request_body
redir
@ -141,6 +142,7 @@ route
# handlers that typically respond to requests
abort
error
copy_response # only in reverse_proxy's handle_response block
respond
metrics
reverse_proxy

View file

@ -533,12 +533,12 @@ path_regexp static \.([a-f0-9]{6})\.(css|js)$
### protocol
```caddy-d
protocol http|https|grpc
protocol http|https|grpc|http/<version>[+]
expression protocol('http|https|grpc')
```
By request protocol.
By request protocol. A broad protocol name such as `http`, `https`, or `grpc` can be used; or specific or minimum HTTP versions such as `http/1.1` or `http/2+`.
There can only be one `protocol` matcher per named matcher.

View file

@ -180,7 +180,8 @@ Prints the environment as seen by caddy, then exits. Can be useful when debuggin
[--domain &lt;example.com&gt;]
[--browse]
[--templates]
[--access-log]</code></pre>
[--access-log]
[--debug]</code></pre>
Spins up a simple but production-ready static file server.
@ -196,6 +197,8 @@ Spins up a simple but production-ready static file server.
`--access-log` enables the request/access log.
`--debug` enables verbose logging.
This command disables the admin API, making it easier to run multiple instances on a local development machine.
@ -373,7 +376,8 @@ Pipe in a maintenance page:
[--from &lt;addr&gt;]
--to &lt;addr&gt;
[--change-host-header]
[--internal-certs]</code></pre>
[--internal-certs]
[--debug]</code></pre>
Spins up a simple but production-ready HTTP(S) reverse proxy.
@ -385,6 +389,8 @@ Spins up a simple but production-ready HTTP(S) reverse proxy.
`--internal-certs` will cause Caddy to issue certificates using its internal issuer (effectively self-signed) for the domain specified in the `--from` address.
`--debug` enables verbose logging.
Both `--from` and `--to` parameters can be URLs, as scheme and domain name will be inferred from the provided URL (paths and query strings ignored). Or they can be a simple network address and not a complete URL.
This command disables the admin API so it is easier to run multiple instances on a local development machine.

View file

@ -184,7 +184,7 @@ To emit logs, get a logger in your module's Provision method:
```go
func (g *Gizmo) Provision(ctx caddy.Context) error {
g.logger = ctx.Logger(g) // g.logger is a *zap.Logger
g.logger = ctx.Logger() // g.logger is a *zap.Logger
}
```