From 1f962372aff2324ef32a162bb35ee93da335a4f4 Mon Sep 17 00:00:00 2001 From: Daenney Date: Tue, 21 Nov 2023 11:36:31 +0100 Subject: [PATCH] [docs] Annotate split-domain setup (#2372) This adds account-domain and host comments next to each config line to hopefully make it easier for folks to understand what goes where. --- docs/advanced/host-account-domain.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/advanced/host-account-domain.md b/docs/advanced/host-account-domain.md index 66c2072a7..d9223a773 100644 --- a/docs/advanced/host-account-domain.md +++ b/docs/advanced/host-account-domain.md @@ -71,18 +71,18 @@ In order to configure the redirect, you'll need to configure it on the account d ```nginx server { - server_name example.org; + server_name example.org; # account-domain location /.well-known/webfinger { - rewrite ^.*$ https://social.example.org/.well-known/webfinger permanent; + rewrite ^.*$ https://social.example.org/.well-known/webfinger permanent; # host } location /.well-known/host-meta { - rewrite ^.*$ https://social.example.org/.well-known/host-meta permanent; + rewrite ^.*$ https://social.example.org/.well-known/host-meta permanent; # host } location /.well-known/nodeinfo { - rewrite ^.*$ https://social.example.org/.well-known/nodeinfo permanent; + rewrite ^.*$ https://social.example.org/.well-known/nodeinfo permanent; # host } } ``` @@ -96,10 +96,10 @@ myservice: image: foo # Other stuff labels: - - 'traefik.http.routers.myservice.rule=Host(`example.org`)' + - 'traefik.http.routers.myservice.rule=Host(`example.org`)' # account-domain - 'traefik.http.middlewares.myservice-gts.redirectregex.permanent=true' - - 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo|host-meta)$$' - - 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://social.$${1}/.well-known/$${2}' + - 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo|host-meta)$$' # host + - 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://social.$${1}/.well-known/$${2}' # host - 'traefik.http.routers.myservice.middlewares=myservice-gts@docker' ``` @@ -108,10 +108,10 @@ myservice: Ensure that the redirect is configured on the account domain in your `Caddyfile`. The following example assumes the account domain as `example.com`, and host domain as `social.example.com`. ``` -example.com { - redir /.well-known/host-meta* https://social.example.com{uri} permanent - redir /.well-known/webfinger* https://social.example.com{uri} permanent - redir /.well-known/nodeinfo* https://social.example.com{uri} permanent +example.com { # account-domain + redir /.well-known/host-meta* https://social.example.com{uri} permanent # host + redir /.well-known/webfinger* https://social.example.com{uri} permanent # host + redir /.well-known/nodeinfo* https://social.example.com{uri} permanent # host } ```