Start typing to search across invoices, services, domains, tickets, and more...
The most practical way to run a mobile app or SaaS API backend for mainland China users without ICP filing is to host it on a Hong Kong server with China Telecom CN2 GIA (AS4809) routing, put Nginx in front as the API gateway, and push static files to a CDN. IMIDC offers exactly this: Hong Kong CN2 GIA VPS from $18/mo and Hong Kong dedicated servers from $139/mo, with DDoS protection and 24/7 multilingual support.
An API backend multiplies network latency, because each app screen usually triggers several sequential requests.
A login screen might call token refresh, user profile, feature flags and a feed endpoint one after another. If each round trip costs 40 ms, the screen feels instant; if evening congestion on an ordinary international route pushes it to 250 ms with 3% packet loss, the same screen takes well over a second and some calls time out. Mobile networks add their own jitter on top. This is why the route between your server and the three mainland carriers matters more for an API than raw server specs.
Keep the dynamic API in Hong Kong on CN2 GIA and move everything cacheable to a CDN.
| Layer | Typical software | Where it runs | Notes |
|---|---|---|---|
| API gateway / TLS | Nginx, OpenResty, Kong, Traefik | Hong Kong CN2 GIA server | HTTP/2 + HTTP/3, rate limiting, keepalive to upstreams |
| App servers | Node.js, Go, Java/Spring, Python, PHP | Same server or private network | Stateless, scale horizontally |
| Cache / sessions / queues | Redis | Private network, never public | Hot data, rate-limit counters, job queues |
| Database | MySQL, PostgreSQL | Dedicated server with SSD/NVMe | Daily off-site backups, replica when you grow |
| Static files, images, app updates | Object storage + CDN | IMIDC CDN in front of origin | Long cache headers, hashed file names |
| Push, SMS, maps | Providers that serve mainland China | Called from the backend | Pick vendors that work for mainland users |
One important limit: OpenAI, Anthropic Claude and Google Gemini APIs are officially unavailable in Hong Kong and mainland China. Do not design your Hong Kong backend around calling them; if your product needs AI features for mainland users, use model providers that are permitted to serve that market.
CN2 GIA is China Telecom's premium international network, and its value for APIs is consistency at peak hours rather than a headline speed number.
| Route to mainland users | Off-peak | Evening peak | Fit for API backends |
|---|---|---|---|
| Hong Kong CN2 GIA (AS4809) | Short, direct path | Designed to stay stable; low loss is typical | Best fit for China-facing APIs |
| Hong Kong ordinary international transit | Often fine | Congestion and loss are common | Risky for chatty APIs |
| Los Angeles with CN2 / Unicom 9929 | Higher RTT due to distance | Stable on premium routes | Good for global apps with China users |
| Tokyo VPS with CN2 option | Moderate RTT | Stable on the optimized route | Good for Japan + China audiences |
No provider can guarantee a specific latency to every user, because the last mile (home broadband, 4G/5G) is outside the data center. Test from real carrier networks before you launch, as shown below.
Terminate TLS once at the gateway, keep warm connections to the app servers, and fail fast on dead upstreams.
upstream api_backend {
server 10.0.0.11:8080 max_fails=3 fail_timeout=10s;
server 10.0.0.12:8080 max_fails=3 fail_timeout=10s;
keepalive 64;
}
limit_req_zone $binary_remote_addr zone=api:20m rate=20r/s;
server {
listen 443 ssl;
listen 443 quic reuseport; # HTTP/3 (nginx 1.25+ built with QUIC)
http2 on;
server_name api.example.com;
ssl_certificate /etc/nginx/ssl/api.example.com.crt;
ssl_certificate_key /etc/nginx/ssl/api.example.com.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 1d;
add_header Alt-Svc 'h3=":443"; ma=86400' always;
gzip on;
gzip_types application/json;
client_max_body_size 20m;
keepalive_timeout 75s;
location /v1/ {
limit_req zone=api burst=40 nodelay;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 3s;
proxy_read_timeout 15s;
proxy_next_upstream error timeout http_502 http_503;
proxy_next_upstream_tries 2;
proxy_pass http://api_backend;
}
}
Open UDP 443 for QUIC and verify HTTP/3 is advertised:
# open TCP 443 and UDP 443 (QUIC / HTTP/3)
ufw allow 443/tcp
ufw allow 443/udp
nginx -t && systemctl reload nginx
curl -sI --http3 https://api.example.com/v1/health | head -1
non_idempotent, which you normally should not.proxy_read_timeout slightly longer than your slowest legitimate endpoint and move long jobs to a queue.Mobile clients should use short per-attempt timeouts, exponential backoff with jitter, and idempotency keys for writes.
async function callApi(url, opts = {}, attempts = 3) {
for (let i = 0; i < attempts; i++) {
const ctrl = new AbortController();
const timer = setTimeout(() => ctrl.abort(), 8000); // per-attempt timeout
try {
const r = await fetch(url, { ...opts, signal: ctrl.signal });
if (r.status < 500 && r.status !== 429) return r; // do not retry 4xx
} catch (e) { /* network error or timeout */ }
finally { clearTimeout(timer); }
const delay = Math.min(4000, 300 * 2 ** i) * (0.5 + Math.random()); // backoff + jitter
await new Promise(res => setTimeout(res, delay));
}
throw new Error('API unavailable');
}
// for POST/PUT send a header such as Idempotency-Key: <uuid> so retries are safe
Retry-After.Measure from all three mainland carriers, at evening peak, before you commit to a route.
# per-phase timing of one API call (run from a probe or a test phone with Termux)
curl -o /dev/null -s -w 'dns=%{time_namelookup} tcp=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' \
https://api.example.com/v1/health
# route and loss, with AS numbers - look for AS4809 on the China Telecom path
mtr -rwzc 100 203.0.113.10
Public APIs attract both volumetric floods and application-layer abuse, so protect both layers.
limit_req), and use signed tokens (JWT with short expiry) for authentication.Start small on a VPS, then split roles onto dedicated servers as traffic grows.
| Stage | Typical setup | IMIDC product |
|---|---|---|
| MVP / beta | Nginx + app + Redis + DB on one machine | Hong Kong CN2 GIA VPS (from $18/mo) |
| Growing app | Gateway + app on VPS, DB on a dedicated server | VPS + Hong Kong dedicated (from $139/mo) |
| Production at scale | 2+ gateways, app pool, DB primary + replica, CDN | Multiple Hong Kong dedicated servers + IMIDC CDN |
| Regional expansion | Add Tokyo, Singapore or Los Angeles nodes for non-China users | Japan / USA dedicated, Anycast via BGP |
IMIDC offers free server migration, which helps when you move the database from a VPS to a dedicated machine.
Match the product to your stage and audience.
IMIDC provides Hong Kong VPS and dedicated servers on China Telecom CN2 GIA (AS4809). Because the servers are in Hong Kong, hosting does not require ICP filing, though your content and app must still comply with applicable laws.
ICP filing applies to hosting inside mainland China, so a Hong Kong API server does not need it. Distributing an app through mainland app stores may involve separate app filing requirements; check with your distributor or counsel, as this is not legal advice.
No. These APIs are not officially available in Hong Kong or mainland China, so they should not be called from a Hong Kong server. For AI features aimed at mainland users, use model providers that are allowed to serve that market.
A Hong Kong CN2 GIA VPS from $18/mo is enough for an MVP or a few thousand daily users with light queries. Move the database to a Hong Kong dedicated server from $139/mo when disk I/O or memory becomes the bottleneck.
It often helps on mobile networks with loss or frequent network switching. Some networks restrict UDP, so always keep HTTP/2 over TCP as the fallback, which browsers and modern HTTP clients do automatically.
Ready to deploy your API close to mainland users? Compare Hong Kong CN2 GIA VPS and Hong Kong dedicated servers, or open a ticket to ask about routes and architecture from the IMIDC team.