From 1129c0c85c7acc5d7d839815cb5dc3ce73c73aa5 Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Wed, 13 Aug 2025 22:37:48 -0800 Subject: [PATCH] add caddy errors --- services/our/Caddyfile | 32 +++++++++++++++++++++++-- services/our/compose.production.yaml | 1 + services/our/errors/401.html | 25 +++++++++++++++++++ services/our/errors/403.html | 36 ++++++++++++++++++++++++++++ services/our/errors/404.html | 35 +++++++++++++++++++++++++++ services/our/errors/500.html | 36 ++++++++++++++++++++++++++++ 6 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 services/our/errors/401.html create mode 100644 services/our/errors/403.html create mode 100644 services/our/errors/404.html create mode 100644 services/our/errors/500.html diff --git a/services/our/Caddyfile b/services/our/Caddyfile index dab2a44..82d660a 100644 --- a/services/our/Caddyfile +++ b/services/our/Caddyfile @@ -1,3 +1,31 @@ -future.porn +future.porn { + reverse_proxy server:5000 -reverse_proxy server:5000 + handle_errors { + root * /srv/errors + + @401 expression `{http.error.status_code} == 401` + handle @401 { + rewrite * /401.html + file_server + } + + @403 expression `{http.error.status_code} == 403` + handle @403 { + rewrite * /403.html + file_server + } + + @404 expression `{http.error.status_code} == 404` + handle @404 { + rewrite * /404.html + file_server + } + + @5xx expression `{http.error.status_code} >= 500` + handle @5xx { + rewrite * /500.html + file_server + } + } +} diff --git a/services/our/compose.production.yaml b/services/our/compose.production.yaml index 83ba4f3..93b19bb 100644 --- a/services/our/compose.production.yaml +++ b/services/our/compose.production.yaml @@ -9,6 +9,7 @@ services: - "443:443" volumes: - ./Caddyfile:/etc/caddy/Caddyfile + - ./errors:/srv/errors networks: - default diff --git a/services/our/errors/401.html b/services/our/errors/401.html new file mode 100644 index 0000000..5977ce2 --- /dev/null +++ b/services/our/errors/401.html @@ -0,0 +1,25 @@ + + + + + + + future.porn - Unauthorized + + + + +
+
+

401 - Unauthorized

+

You are not authorized to access this page. Please log in and try + again.

+ +
+ 401 Cat +
+
+
+ + + \ No newline at end of file diff --git a/services/our/errors/403.html b/services/our/errors/403.html new file mode 100644 index 0000000..8db1a44 --- /dev/null +++ b/services/our/errors/403.html @@ -0,0 +1,36 @@ + + + + + + + future.porn - Access Denied + + + + +
+
+

403 - Forbidden

+

You found the velvet rope… but you're not on the list.

+ +
+

This page is off-limits. It might be private, restricted, or just not ready for public viewing.

+

+ You can: +

+ +
+ +
+ 403 Cat +
+
+
+ + + \ No newline at end of file diff --git a/services/our/errors/404.html b/services/our/errors/404.html new file mode 100644 index 0000000..1f3374a --- /dev/null +++ b/services/our/errors/404.html @@ -0,0 +1,35 @@ + + + + + + + future.porn - Page Not Found + + + + +
+
+

404 - Page Not Found

+

Looks like you took a wrong turn in the timeline.

+ +
+

The page you're looking for doesn't exist or has been moved.

+

+ You can: +

+ +
+ +
+ 404 Cat +
+
+
+ + + \ No newline at end of file diff --git a/services/our/errors/500.html b/services/our/errors/500.html new file mode 100644 index 0000000..5d563c6 --- /dev/null +++ b/services/our/errors/500.html @@ -0,0 +1,36 @@ + + + + + + + future.porn - Internal Server Error + + + + +
+
+

500 - Internal Server Error

+

The timeline has glitched. We're working on it.

+ +
+

Something went wrong on our side. A human has been notified.

+

+ You can: +

+ +
+ +
+ 500 Cat +
+
+
+ + + \ No newline at end of file