Previously working Node subdomains (e.g. .ipnt.uk) no longer work. Need to add host header checking and redirect to the proper node page (e.g. https://ipnt.uk/nodes/)
Previously working Node subdomains (e.g. <node-name>.ipnt.uk) no longer work. Need to add `host` header checking and redirect to the proper node page (e.g. https://ipnt.uk/nodes/<pub>)
<!-- github-sync-id:3794339313 -->
Issue #146 — Node subdomains (e.g. <node-name>.ipnt.uk) no longer redirect to the corresponding node page (/nodes/<public_key>).
Current State
There is no subdomain/host-header redirect logic anywhere in the codebase. Specifically:
No middleware inspects the Host header for subdomain-based routing. The web app only has CacheControlMiddleware and ProxyHeadersMiddleware (for X-Forwarded-* headers).
No server-side code reads request.headers.get("host") or performs host-based redirects.
No client-side code inspects window.location.hostname for subdomain routing — the SPA router is purely path-based.
NETWORK_DOMAIN is defined in WebSettings (config.py:303) but is never consumed by any code.
What Needs to Happen
The fix requires a server-side middleware (in src/meshcore_hub/web/middleware.py or app.py) that:
Reads the Host header on each request
If the host matches a subdomain pattern (e.g. <subdomain>.ipnt.uk where ipnt.uk is NETWORK_DOMAIN):
Resolves the subdomain to a node (by name tag, advertised name, or similar)
Redirects to https://<base_domain>/nodes/<public_key>
Needs NETWORK_DOMAIN to be configured and the node lookup logic to map subdomain labels to nodes
## Issue Summary: Node Subdomains No Longer Work
**Issue #146** — Node subdomains (e.g. `<node-name>.ipnt.uk`) no longer redirect to the corresponding node page (`/nodes/<public_key>`).
### Current State
**There is no subdomain/host-header redirect logic anywhere in the codebase.** Specifically:
- **No middleware** inspects the `Host` header for subdomain-based routing. The web app only has `CacheControlMiddleware` and `ProxyHeadersMiddleware` (for `X-Forwarded-*` headers).
- **No server-side code** reads `request.headers.get("host")` or performs host-based redirects.
- **No client-side code** inspects `window.location.hostname` for subdomain routing — the SPA router is purely path-based.
- **`NETWORK_DOMAIN`** is defined in `WebSettings` (`config.py:303`) but is **never consumed by any code**.
### What Needs to Happen
The fix requires a server-side middleware (in `src/meshcore_hub/web/middleware.py` or `app.py`) that:
1. Reads the `Host` header on each request
2. If the host matches a subdomain pattern (e.g. `<subdomain>.ipnt.uk` where `ipnt.uk` is `NETWORK_DOMAIN`):
- Resolves the subdomain to a node (by name tag, advertised name, or similar)
- Redirects to `https://<base_domain>/nodes/<public_key>`
3. Needs `NETWORK_DOMAIN` to be configured and the node lookup logic to map subdomain labels to nodes
<a href="https://opencode.ai/s/8f2mrjia"><img width="200" alt="New%20session%20-%202026-04-17T22%3A18%3A42.478Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTA0LTE3VDIyOjE4OjQyLjQ3OFo=.png?model=zai-coding-plan/glm-5.1&version=1.4.10&id=8f2mrjia" /></a>
[opencode session](https://opencode.ai/s/8f2mrjia) | [github run](/ipnet-mesh/meshcore-hub/actions/runs/24589127845)
<!-- github-comment-id:4271658746 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Previously working Node subdomains (e.g. .ipnt.uk) no longer work. Need to add
hostheader checking and redirect to the proper node page (e.g. https://ipnt.uk/nodes/)The subdomains now load the website but still don't # redirect to the node page. Ongoing.
/oc summarize
Issue Summary: Node Subdomains No Longer Work
Issue #146 — Node subdomains (e.g.
<node-name>.ipnt.uk) no longer redirect to the corresponding node page (/nodes/<public_key>).Current State
There is no subdomain/host-header redirect logic anywhere in the codebase. Specifically:
Hostheader for subdomain-based routing. The web app only hasCacheControlMiddlewareandProxyHeadersMiddleware(forX-Forwarded-*headers).request.headers.get("host")or performs host-based redirects.window.location.hostnamefor subdomain routing — the SPA router is purely path-based.NETWORK_DOMAINis defined inWebSettings(config.py:303) but is never consumed by any code.What Needs to Happen
The fix requires a server-side middleware (in
src/meshcore_hub/web/middleware.pyorapp.py) that:Hostheader on each request<subdomain>.ipnt.ukwhereipnt.ukisNETWORK_DOMAIN):https://<base_domain>/nodes/<public_key>NETWORK_DOMAINto be configured and the node lookup logic to map subdomain labels to nodesopencode session | github run