commit dc766f9e6fe5b7abffd95fc190adc29918759c7c parent 356e238793e16569f23723c338db72a0b2c8c344 Author: ketan-vijayvargiya <7019732+ketan-vijayvargiya@users.noreply.github.com> Date: Mon, 30 Jan 2023 01:47:03 -0800 [docs] Add an example on how to setup redirect with Traefik (#1395) Diffstat:
M | docs/installation_guide/advanced.md | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/docs/installation_guide/advanced.md b/docs/installation_guide/advanced.md @@ -82,6 +82,20 @@ http { The above configuration [rewrites](https://www.nginx.com/blog/creating-nginx-rewrite-rules/) queries to `example.org/.well-known/webfinger` and `example.org/.well-known/nodeinfo` to their `fedi.example.org` counterparts, which means that query information is preserved, making it easier to follow the redirect. +If `example.org` is running on [Traefik](https://doc.traefik.io/traefik/), we could use labels similar to the following to setup the redirect. + +```docker + myservice: + image: foo + # Other stuff + labels: + - 'traefik.http.routers.myservice.rule=Host(`example.org`)' + - 'traefik.http.middlewares.myservice-gts.redirectregex.permanent=true' + - 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo)$$' + - 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://fedi.$${1}/.well-known/$${2}' + - 'traefik.http.routers.myservice.middlewares=myservice-gts@docker' +``` + ### Step 3: What now? Once you've done steps 1 and 2, proceed as normal with the rest of your GoToSocial installation.