Supabase Custom Domains vs Proxy: Which Fixes the India Block?
Two real fixes keep coming up in every "Supabase blocked in India" discussion: Custom Domains (a Supabase feature) and a reverse proxy (Cloudflare Worker or similar). Both work. But they're very different in cost, setup time, and what they require from you.
Here's the honest comparison.
Quick Comparison
| Custom Domains | Proxy | |
|---|---|---|
| Setup time | 30-60 min | 5-10 min |
| Code changes | One URL change | One URL change |
| Cost | $25/mo+ (Pro plan required) | $0-5/mo |
| DNS setup needed? | Yes (CNAME + verification) | No (or your own domain) |
| Supabase plan | Pro or higher ($25/mo min) | Any plan (including free) |
| Latency added | ~0ms (direct to Supabase) | ~20-50ms (proxy hop) |
| Maintenance | Supabase manages it | You or a managed service |
| Works with free tier? | No | Yes |
Option 1: Supabase Custom Domains
Supabase lets you map your own domain (e.g., api.yourapp.com) to your Supabase project. Instead of your app calling abc123.supabase.co, it calls api.yourapp.com — which resolves to Supabase's infrastructure but isn't on the blocked domain.
How to Set It Up
- Go to your Supabase dashboard → Settings → Custom Domains
- Enter your desired domain (e.g.,
api.yourapp.com) - Add the CNAME record Supabase gives you to your DNS provider
- Add the TXT verification record
- Wait for DNS propagation (minutes to hours)
- Update your app's Supabase URL to use the custom domain
// Before const supabase = createClient( 'https://abc123.supabase.co', 'your-anon-key' ); // After (Custom Domain) const supabase = createClient( 'https://api.yourapp.com', 'your-anon-key' );
Pros
- Zero latency added — traffic goes directly to Supabase, just via your domain
- Supabase manages SSL and routing — no infrastructure for you to maintain
- Official, supported solution — Supabase recommends this
- Professional appearance — your API is on your domain
Cons
- Requires Pro plan ($25/month minimum) — if you're on the free tier, you need to upgrade just to use this feature
- DNS setup required — you need a domain and access to its DNS settings. If you're using a free subdomain or don't own a domain, this doesn't work
- Propagation delay — DNS changes can take minutes to hours to propagate globally
- One domain per project — if you have multiple Supabase projects, each needs its own custom domain
Option 2: Reverse Proxy (Cloudflare Worker / Vercel Edge)
A lightweight serverless function sits between your app and Supabase. Your app calls the proxy, the proxy forwards to Supabase, Supabase responds through the proxy. The ISP sees your proxy domain, not *.supabase.co.
How to Set It Up
Self-hosted (Cloudflare Worker — free):
export default {
async fetch(request) {
const url = new URL(request.url);
const match = url.pathname.match(/^\/v1\/([^/]+)(\/.*)/);
if (!match) return new Response('Invalid path', { status: 400 });
const [, projectRef, apiPath] = match;
const target = `https://${projectRef}.supabase.co${apiPath}${url.search}`;
return fetch(target, {
method: request.method,
headers: request.headers,
body: request.body
});
}
}Then in your app:
const supabase = createClient( 'https://your-proxy.workers.dev/v1/abc123', 'your-anon-key' );
Pros
- Works with any Supabase plan — including free tier
- 5-minute setup — deploy one function, change one URL
- $0 cost — Cloudflare Workers free tier handles 100K requests/day
- No DNS changes required — the proxy has its own domain
- Works for multiple projects — one proxy can handle any project ref
Cons
- 20-50ms added latency — every request takes an extra hop through the proxy
- You maintain it — uptime, rate limiting, CORS headers are your responsibility (unless you use a managed proxy)
- Security surface area — the proxy sees your requests in transit (it doesn't store them, but it's an additional trust point)
What About Other Workarounds?
VPN / DNS Change (1.1.1.1, 8.8.8.8)
Works for you during development. Doesn't work for your users. You can't ask every Indian user to install a VPN or change their DNS. This is a developer workaround, not a production fix.
SupaDNS
An open-source project that uses DNS-over-HTTPS to resolve Supabase domains. Clever approach, but it requires the JS library to be included in your client-side code, adding complexity. It also only works for DNS-level blocking — if ISPs are doing deep packet inspection, it may not help.
Move Server Outside India
If your backend is on an Indian VPS, moving it to Singapore or Frankfurt fixes server-to-Supabase connectivity. But it doesn't fix client-side calls from Indian browsers directly to Supabase. Only helps if all Supabase calls go through your backend.
Decision Matrix
| Your situation | Best option |
|---|---|
| On Supabase Pro+ and own a domain | Custom Domains — cleanest, zero latency |
| On Supabase free tier | Proxy — only option that works without upgrading |
| Need a fix in under 10 minutes | Proxy — deploy a Worker, change one URL |
| Building a high-performance app | Custom Domains — no latency penalty |
| Multiple Supabase projects | Proxy — one proxy handles all projects |
| Don't want to maintain infrastructure | Custom Domains or managed proxy |
| Budget-constrained | Self-hosted proxy — $0 on Cloudflare free tier |
Don't Want to Self-Host a Proxy?
SupaRoute is a managed Supabase proxy. One URL change, $5/month, handles CORS/SSL/rate limiting. Works with any Supabase plan including free.
Get SupaRoute →