mirror of
https://github.com/caddyserver/website.git
synced 2025-05-07 04:07:13 -04:00
docs: Add 404 handling
This commit is contained in:
parent
e0f5ee1bb9
commit
bb089ddb37
2 changed files with 37 additions and 0 deletions
13
Caddyfile
13
Caddyfile
|
@ -15,3 +15,16 @@ rewrite /docs/modules/* /docs/modules/index.html
|
|||
rewrite /docs/* /docs/index.html
|
||||
|
||||
reverse_proxy /api/* localhost:4444
|
||||
|
||||
handle_errors {
|
||||
@error {
|
||||
expression {http.error.status_code} in [404, 500]
|
||||
}
|
||||
handle @error {
|
||||
rewrite 404.html
|
||||
root * src
|
||||
encode gzip
|
||||
templates
|
||||
file_server
|
||||
}
|
||||
}
|
||||
|
|
24
src/404.html
Normal file
24
src/404.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>404 — Caddy Documentation</title>
|
||||
{{include "/includes/docs-head.html"}}
|
||||
<meta property="og:title" content="404 - Caddy Documentation">
|
||||
<meta name="twitter:title" value="404 - Caddy Documentation">
|
||||
</head>
|
||||
<body>
|
||||
{{include "/includes/docs-header.html"}}
|
||||
<main>
|
||||
{{include "/includes/docs-nav.html"}}
|
||||
<div class="article-container">
|
||||
<div class="paper" id="paper1"></div>
|
||||
<div class="paper" id="paper2"></div>
|
||||
<article class="paper paper3">
|
||||
{{markdown "# 404\n\n<center>Sorry! The page you requested wasn't found.</center>"}}
|
||||
</article>
|
||||
</div>
|
||||
<div class="sidebar"></div>
|
||||
</main>
|
||||
{{include "/includes/footer.html"}}
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue