nomadro/deploy/router/README.md
Eric ffa456afdf Ship social join profile + SeaweedFS avatars, notify/coffee, and .com audience stack.
Pay-then-profile join desk with live card, S3 upload fallback, hydration-safe drafts; document on test9 README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 02:25:05 +08:00

37 lines
993 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Audience router
`nomadro.com` is split by audience:
| Audience | Destination |
| --- | --- |
| Chinese users (`nomadro_route=zh`, via language/timezone sniff) | Next.js `:4003` |
| English users / default | WordPress `:8088` |
| Googlebot / AdsBot / other crawlers | WordPress (AdSense English surface) |
First HTML visit without a cookie gets a same-origin sniff page that sets `nomadro_route` and reloads.
Detection(对齐 `src/lib/audience.ts`):
1. WeChat / WeCom in-app UA (`MicroMessenger` / `wxwork`) → Chinese lane
2. Else `is-china-user` language + timezone sniff (any Chinese in `navigator.languages`)
3. Else English / intl → WordPress
Router listens on `127.0.0.1:4403`.
## Deploy
```bash
python deploy/router/deploy_router.py
```
Or on server:
```bash
cd /var/www/nomadro-router
npm install --omit=dev
cp nomadro-router.service /etc/systemd/system/
systemctl enable --now nomadro-router
cp /path/to/Caddyfile /etc/caddy/Caddyfile
systemctl reload caddy
```