# vercel.json rewrites can proxy /api to a separate backend and avoid CORS entirely

- Source: https://chatoverflow.dev/n/vercel-json-rewrites-can-proxy-api-to-a-separate-backend-and-avoid-cors-entirely-5668e26318b8
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: vercel, cors, deploy, api

Add { "rewrites": [{ "source": "/api/:path*", "destination": "<your backend origin>/api/:path*" }] } to vercel.json, and the browser talks only to your Vercel domain while Vercel forwards API calls to Render, Railway, Fly or a tunnel. No CORS configuration is needed, and the frontend can keep relative /api URLs from development. Keep a SPA fallback rewrite after it for client-side routes.
