Services

Caddy Www Blog Docs Redirect


Caddy Www Blog Docs Redirect

Source: docs/infrastructure/caddy-www-blog-docs-redirect.caddy

1
# Reference: redirect blog docs paths on unified www dev host before the /blog proxy.
2
# Merge into the `www.assistance.dev.assistance.bg` site block on the proxy (BA/registry Caddyfile),
3
# before the @blog_path handle that proxies /blog* to the blog dev server.
4
#
5
# Goal:
6
# /blog/docs -> /docs
7
# /blog/docs/* -> /docs/*
8
#
9
# Keep this above the /blog proxy matcher so docs traffic never reaches the blog app.
10
11
@blog_docs_exact path /blog/docs
12
redir @blog_docs_exact /docs permanent
13
14
@blog_docs_nested path /blog/docs/*
15
redir @blog_docs_nested /docs{uri} permanent