Best approaches for hosting ASP.NET Core API with React SPA in production 2025?

I’m looking for advice on production deployment strategies for a typical setup with ASP.NET Core handling the API and React managing the frontend.

My preference is to keep everything under one domain where the React build files get served from the root directory and API calls go to something like /api/ endpoints. In the past I’ve mostly worked with IIS deployments on Windows servers but I want to explore options that are more cost effective and have better developer experience.

I’ve seen some teams use reverse proxies and similar setups but those solutions always seemed like workarounds rather than proper architectures.

For context, I’m working with a project structure similar to what you get from Visual Studio’s ASP.NET Core + React template. It creates separate projects for the server side (.Server) and client side (.Client) with Vite handling the dev server proxy during local development.

What deployment strategies are working well for you in production environments? Any recommendations for hosting platforms or configuration approaches that handle this stack cleanly?

I’ve done similar deployments and hosting both in a single ASP.NET Core app works great for production. Just configure your API to serve static files from the React build using UseStaticFiles() and UseSpaStaticFiles() middleware. No need for reverse proxies or complex routing. For hosting, go with Azure App Service or AWS Elastic Beanstalk - they handle SSL certs automatically and CI/CD is straightforward. The big win is you’re only managing one app instead of juggling separate frontend and backend deployments. Your build pipeline just runs npm run build for React, then publishes the whole ASP.NET Core project with the built React files in wwwroot.

what’s your expected traffic like? I’ve been eyeing Azure Static Web Apps for exactly this - it hosts SPAs and has built-in API routes that’d pair well with your ASP.NET Core backend. ever think about dockerizing it? that’d make deployment way easier across platforms and keep things clean.

azure container apps works gr8 for this setup. u can deploy the react build and api as separate containers or bundle them together - way cheaper than app service and scales to zero when idle. takes about 10 min to set up with github actions.