How do I deploy the frontend to Vercel with a custom subdomain?
In Vercel project settings, add app.yourdomain.com as a domain. Vercel provides a CNAME record. Add that CNAME in your DNS provider (Name: app, Value: cname.vercel-dns.com). SSL is automatic on Vercel.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Setting Up Subdomains for Frontend and Backend api and app Separation
Clean separation of concerns, independent deployment and scaling, different security and CORS policies, CDN-friendly frontend, and cookie scoping per subdomain. Common setup: api.yourdomain.com for backend, app.yourdomain.com for frontend.
Set sameSite: 'none' (allows cross-site cookies), secure: true (required with sameSite none, HTTPS only), domain: '.yourdomain.com' (shares cookie across all subdomains), and httpOnly: true. This lets the frontend on app.yourdomain.com send cookies to the backend on api.yourdomain.com.
Create separate server blocks for each subdomain: one with server_name api.yourdomain.com and proxy_pass to Node.js, another with server_name app.yourdomain.com and root pointing to the frontend build. Add a redirect from yourdomain.com to app.yourdomain.com.
Still have questions?
Browse all our FAQs or reach out to our support team
