Skip to content
LovelyTools
EN

CORS Header Generator

Build Access-Control-Allow headers and server snippets for CORS.

Processed locally on your device — nothing is uploaded.

About the CORS Header Generator

Cross-Origin Resource Sharing errors are among the most common problems when a front end calls an API on another domain. The fix is a handful of response headers — but the rules are strict: a wildcard origin cannot be used together with credentials, preflight OPTIONS requests need their own answer, and caching the preflight saves a round trip on every call.

Enter the allowed origins, methods and headers, choose whether cookies and auth headers are allowed, and set the preflight cache time. The generator outputs the raw headers plus snippets for nginx, Apache .htaccess and Express, and refuses the invalid wildcard-plus-credentials combination that browsers reject.

How to use the CORS Header Generator

  1. Enter the allowed origins, methods and headers.
  2. Choose credentials and the preflight cache time.
  3. Copy the snippet for your server.

Features

  • nginx, Apache and Express
  • Handles preflight OPTIONS
  • Multiple origins
  • Blocks * with credentials

Supported formats

  • Plain text

Frequently asked questions

Can I allow several origins?

The header accepts only one origin per response, so the snippets check the request’s Origin against your list and echo back the one that matches.

Is my text sent anywhere?

No. Everything runs in your browser, so nothing you paste is uploaded or stored.