Edge Delivery Services how-tos · updated

How to add custom HTTP response headers (like CORS) in Edge Delivery Services

Custom response headers are set in the headers object of the site configuration, keyed by a URL glob such as /fragments/**, for example to allow cross-origin requests. aem.live warns that access-control-allow-origin: * can expose preview and live sites to CSRF attacks against authors logged in through Sidekick. Restrict it to one origin and as few URLs as possible.

How the configuration looks

Each key is a glob pattern on the URL path; * works as a prefix or suffix and ** matches deep paths, as in /foo/** or **/bar/**. Each value is a list of key and value pairs for the headers. aem.live also offers an HTTP Headers Editor.

When changes apply

Headers apply to both preview and live. For content, caches are purged automatically and the change is immediate. For code resources, the header applies after the next code sync, either a push to main or a manual resync through the Admin API.

NeedPatternHeader
Let one partner site fetch fragments/fragments/**access-control-allow-origin: https://partner.example.com
Cache a JSON feed briefly/feeds/**A cache-control value your CDN honours
Don't do/**access-control-allow-origin: *

Headers set at your own CDN (BYO CDN) are a separate layer; keep a single source of truth so the two don't conflict.

Site configuration headers (from aem.live's example)

{
  "/fragments/**": [
    { "key": "access-control-allow-origin", "value": "https://www.example.com" }
  ]
}

How to do it

  1. Decide which paths need the header and which origin should be allowed.
  2. Add the glob and header to the site configuration (or the HTTP Headers Editor).
  3. For code resources, trigger a code sync.
  4. Test with curl -I on .page and .live.

Related pages on this site

Questions

Is access-control-allow-origin: * safe on EDS?

aem.live warns it may make preview and live sites vulnerable to CSRF against authors logged in via Sidekick. Allow a specific origin and limit the paths.

Do header changes apply to preview too?

Yes, to both preview and live.

Why hasn't my header appeared on a JS file?

Headers on code resources apply after the next code sync.

Sources

Facts about Adobe's platform are from the linked Adobe pages, checked 10 Nov 2026. Explanations and examples are ours unless marked as Adobe's.

Scan, Convert, Verify, Install

How Surge Migrate helps with a move to Edge Delivery Services

Surge Migrate moves a website from any CMS to any CMS, and Edge Delivery Services is one of the systems it writes. Pages are converted automatically, and you check the result before you install anything.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →

Import kit and one document per page, in the format of Adobe's AEM Importer. The free EDS block mapper shows which of your components map to EDS blocks. For AEM 6.5 code, the free readiness scan lists Cloud Service blockers in your browser. Nothing is uploaded.