# ASW Caddy Error Pages — Caddyfile snippet # # Paste this inside your site block (not at global scope). # Adjust the root path to where your agentic-semantic-web repo lives. # # Assumes asw.css is served at /asw/asw.css # (serve the agentic-semantic-web repo root as /asw/ — see README.md) # ── Error pages ────────────────────────────────────────────────────────────── # # Caddy's handle_errors block intercepts any response with a matching # status code before it reaches the client. # # Rewrite the path to the ASW static error page, then serve it from # the agentic-semantic-web repo root. handle_errors { rewrite * /errors/{http.error.status_code}.html file_server { root /home/exedev/projects/agentic-semantic-web } } # ── Serving asw.css ─────────────────────────────────────────────────────── # # The error pages load asw.css from /asw/asw.css. # Add this route to your site block so the CSS is reachable. # (Skip if you already serve /asw/ from this repo elsewhere.) handle /asw/* { uri strip_prefix /asw file_server { root /home/exedev/projects/agentic-semantic-web } } # ── Example site block ──────────────────────────────────────────────────────── # # example.com { # root * /var/www/html # file_server # # handle /asw/* { # uri strip_prefix /asw # file_server { # root /home/exedev/projects/agentic-semantic-web # } # } # # handle_errors { # rewrite * /errors/{http.error.status_code}.html # file_server { # root /home/exedev/projects/agentic-semantic-web # } # } # } # # Supported error codes (from errors/ directory): # 400 — Bad Request # 401 — Unauthorized # 403 — Forbidden # 404 — Not Found # 500 — Internal Server Error # 502 — Bad Gateway # 503 — Service Unavailable