summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt
parentInitial commit. (diff)
downloadnetdata-upstream.tar.xz
netdata-upstream.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt')
-rw-r--r--web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt52
1 files changed, 52 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt b/web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt
new file mode 100644
index 00000000..94137ae6
--- /dev/null
+++ b/web/server/h2o/libh2o/srcdoc/configure/errordoc_directives.mt
@@ -0,0 +1,52 @@
+? my $ctx = $main::context;
+? $_mt->wrapper_file("wrapper.mt", "Configure", "Errordoc Directives")->(sub {
+
+<p>
+This document describes the configuration directives of the errordoc handler.
+</p>
+
+<?
+$ctx->{directive}->(
+ name => "error-doc",
+ levels => [ qw(global host path extension) ],
+ desc => <<'EOT',
+Specifies the content to be sent when returning an error response (i.e. a response with 4xx or 5xx status code).
+EOT
+)->(sub {
+?>
+<p>
+The argument must be a mapping containing following attributes, or if it is a sequence, every element must be a mapping with the following attributes.
+<ul>
+<li><code>status</code> - three-digit number indicating the status code (or sequence of that from version 2.3)
+<li><code>url</code> - URL of the document to be served
+</ul>
+</p>
+<p>
+URL can either be absolute or relative.
+Only <code>content-type</code>, <code>content-language</code>, <code>set-cookie</code> headers obtained from the specified URL are served to the client.
+</p>
+<p>
+<?= $ctx->{example}->('Set error document for 404 status', <<'EOT')
+error-doc:
+ status: 404
+ url: /404.html
+EOT
+?>
+<?= $ctx->{example}->('Set error document for 500 and 503 status', <<'EOT')
+error-doc:
+ - status: 500
+ url: /internal-error.html
+ - status: 503
+ url: /service-unavailable.html
+EOT
+?>
+<?= $ctx->{example}->('Set error document for 50x statuses (From version 2.3)', <<'EOT')
+error-doc:
+ status: [500, 502, 503, 504]
+ url: /50x.html
+EOT
+?>
+</p>
+? })
+
+? })