From dfc7ab0470e95f4eb29e6aea024d4fd000fbca07 Mon Sep 17 00:00:00 2001
From: Thomas Sileo <t@a4.io>
Date: Mon, 26 Dec 2022 10:48:28 +0100
Subject: [PATCH] Document how to run on subdomains

---
 docs/install.md | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/docs/install.md b/docs/install.md
index bb73b1b..7912835 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -191,6 +191,29 @@ http {
 }
 ```
 
+
+## (Advanced) Running on a subdomain
+
+It is possible to run microblogpub on a subdomain (`sub.domain.tld`) while being reachable from the root root domain (`domain.tld`) using the `name@domain.tld` handle.
+
+This requires forwarding/proxying requests from the root domain to the subdomain, for example using NGINX:
+
+```nginx
+location /.well-known/webfinger {
+  add_header Access-Control-Allow-Origin '*';
+  return 301 https://sub.domain.tld$request_uri;
+}
+```
+
+And updating `data/profile.toml` to specify the root domain as the webfinger domain:
+
+```toml
+webfinger_domain = "domain.tld"
+```
+
+Once configured correctly, people will be able to follow you using `name@domain.tld`, while using `sub.domain.tld` for the web interface.
+
+
 ## (Advanced) Running from subpath
 
 It is possible to configure microblogpub to run from subpath.