From c42996651357c0c2478abd35a55c2bdd9af820be Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 16 Sep 2022 17:03:41 -0600 Subject: [PATCH] docs: General 2.6 updates --- src/docs/markdown/caddyfile/directives.md | 2 ++ src/docs/markdown/caddyfile/matchers.md | 4 ++-- src/docs/markdown/command-line.md | 10 ++++++++-- src/docs/markdown/extending-caddy.md | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/docs/markdown/caddyfile/directives.md b/src/docs/markdown/caddyfile/directives.md index 6790524..9e624fc 100644 --- a/src/docs/markdown/caddyfile/directives.md +++ b/src/docs/markdown/caddyfile/directives.md @@ -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 diff --git a/src/docs/markdown/caddyfile/matchers.md b/src/docs/markdown/caddyfile/matchers.md index 9e2bd2f..27badb3 100644 --- a/src/docs/markdown/caddyfile/matchers.md +++ b/src/docs/markdown/caddyfile/matchers.md @@ -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/[+] 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. diff --git a/src/docs/markdown/command-line.md b/src/docs/markdown/command-line.md index cd864b6..559da7a 100644 --- a/src/docs/markdown/command-line.md +++ b/src/docs/markdown/command-line.md @@ -180,7 +180,8 @@ Prints the environment as seen by caddy, then exits. Can be useful when debuggin [--domain <example.com>] [--browse] [--templates] - [--access-log] + [--access-log] + [--debug] 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 <addr>] --to <addr> [--change-host-header] - [--internal-certs] + [--internal-certs] + [--debug] 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. diff --git a/src/docs/markdown/extending-caddy.md b/src/docs/markdown/extending-caddy.md index 829e672..b983930 100644 --- a/src/docs/markdown/extending-caddy.md +++ b/src/docs/markdown/extending-caddy.md @@ -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 } ```