HTTP · 12 stack presets

CORS & Preflight Simulator

Select a backend and frontend stack below. Each preset loads local ports, custom headers, Fetch Standard preflight checks, server configs, and troubleshooting docs.

All 12 Supported Framework Stacks

12 static guides
Laravel 11/12 APIReact (Vite)

Laravel + React (Vite) CORS Config Simulator & Fix Guide

Simulate and fix CORS preflight errors between Laravel 11/12 APIs and React Vite on port 5173. Generate config/cors.php with credentials and header rules.

Origin: http://localhost:5173
API: http://localhost:8000/api/v1/projects
Simulate & Generate Config
Laravel 11/12 APINext.js App RouterCredentials

Laravel API + Next.js App Router CORS Simulator & Fix Guide

Debug CORS between Laravel 11/12 APIs and Next.js App Router on port 3000. Separate Server Component fetches from Client Component browser preflights.

Origin: http://localhost:3000
API: http://localhost:8000/api/orders
Simulate & Generate Config
Laravel Sanctum APISPA (Cookie Auth)Credentials

Laravel Sanctum SPA Cookie Auth CORS Simulator & Fix Guide

Fix Laravel Sanctum SPA cookie CORS errors. Validate supports_credentials, SANCTUM_STATEFUL_DOMAINS, X-XSRF-TOKEN preflight headers, and SameSite rules.

Origin: http://localhost:5173
API: http://localhost:8000/api/user
Simulate & Generate Config
Python FastAPINext.jsCredentials

FastAPI + Next.js CORS Config Simulator & Fix Guide

Fix CORS preflight failures between Python FastAPI (Uvicorn) and Next.js on port 3000. Configure CORSMiddleware order, trailing redirects, and credentials.

Origin: http://localhost:3000
API: http://localhost:8000/api/v1/documents
Simulate & Generate Config
Python FastAPIReact (Vite)

FastAPI + React (Vite) CORS Config Simulator & Fix Guide

Simulate and resolve CORS errors between Python FastAPI and React Vite on port 5173. Fix preflight OPTIONS failures, Pydantic 422 responses, and upload headers.

Origin: http://localhost:5173
API: http://localhost:8000/api/items
Simulate & Generate Config
Node.js ExpressNext.js App RouterCredentials

Node.js Express + Next.js App Router CORS Simulator & Fix Guide

Fix CORS preflight and cookie credential errors between Node.js Express APIs and Next.js App Router. Configure cors() middleware, app.options, and Helmet.

Origin: http://localhost:3000
API: http://localhost:4000/api/auth/session
Simulate & Generate Config
Node.js ExpressReact (Vite)

Node.js Express + React (Vite) CORS Config Simulator & Fix Guide

Resolve CORS preflight errors between Node.js Express APIs and React Vite on port 5173. Generate cors() configs, fix PATCH/DELETE methods, and debug headers.

Origin: http://localhost:5173
API: http://localhost:5000/api/tasks/19
Simulate & Generate Config
Next.js Route HandlersExternal SPA / Widget

Next.js Route Handlers + External Frontend CORS Simulator & Fix Guide

Configure CORS for Next.js App Router Route Handlers serving external SPAs or widgets. Fix 405 OPTIONS preflights, next.config.ts headers, and Vary: Origin.

Origin: https://client.example.com
API: https://api.myapp.com/api/public/checkout
Simulate & Generate Config
ASP.NET Core 8/9 Web APIAngular (Port 4200)Credentials

ASP.NET Core 8/9 + Angular CORS Config Simulator & Fix Guide

Fix CORS errors between ASP.NET Core 8/9 Web API and Angular CLI on port 4200. Verify UseCors middleware ordering, AllowCredentials, and HTTPS redirects.

Origin: http://localhost:4200
API: https://localhost:7142/api/customers
Simulate & Generate Config
ASP.NET Core Web APIReact Frontend

ASP.NET Core Web API + React CORS Config Simulator & Fix Guide

Simulate and fix CORS preflight errors between ASP.NET Core 8/9 Web API and React (Vite/CRA). Debug Minimal APIs, Dev Certs, exposed headers, and cookies.

Origin: http://localhost:5173
API: https://localhost:7001/api/invoices
Simulate & Generate Config
Nginx Reverse ProxySPA + Docker APICredentials

Nginx Reverse Proxy + Docker API CORS Simulator & Fix Guide

Fix Nginx reverse proxy CORS bugs for Docker APIs. Prevent duplicate Access-Control-Allow-Origin headers, add always on 4xx/5xx errors, and handle OPTIONS 204.

Origin: https://app.example.com
API: https://api.example.com/api/v1/reports
Simulate & Generate Config
Cloudflare Workers APIStatic SPA (Pages/Vite)

Cloudflare Workers API + SPA Frontend CORS Simulator & Fix Guide

Fix CORS preflight failures between Cloudflare Workers APIs and static SPAs on Pages, Vercel, or Netlify. Handle OPTIONS 204, immutable headers, and Vary.

Origin: https://app.opscheck.dev
API: https://api.opscheck.dev/v1/validate
Simulate & Generate Config

Core Fetch Standard CORS Rules Validated by OpsCheck

1. No Wildcards With Credentials

When credentials: "include" or Access-Control-Allow-Credentials: true is active, browsers strictly reject Access-Control-Allow-Origin: * and require an exact origin match.

2. Strict Origin Formatting

Browser Origin headers contain scheme, host, and non-default port only—never a trailing slash or path. Even localhost vs. 127.0.0.1 fails equality checks.

3. Preflight (OPTIONS) Triggers

Any PUT, PATCH, or DELETE call, application/json payload, or custom header like Authorization requires a 2xx OPTIONS response before the real request runs.