33 lines
860 B
Markdown
33 lines
860 B
Markdown
# 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 matches `is-china-user` language + timezone signals (any Chinese language in `navigator.languages` counts).
|
|
|
|
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
|
|
```
|