Fix Gutenberg Blob Worker and iframe CSP Errors in Nginx

When Gutenberg reports that a blob: worker or frame violates Content Security Policy, fix the specific directives instead of removing CSP. Add blob: to the worker and frame source lists that the editor needs, and use double-quoted origins inside a Permissions Policy allowlist.

Last updated: November 21, 2026.

add_header Content-Security-Policy "default-src 'self'; worker-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'" always;

add_header Permissions-Policy 'geolocation=*, camera=(self "https://admin.example.com"), microphone=()' always;

Treat this as a focused example, not a universal policy. Replace the example origin and merge the two blob: allowances into the site’s complete, tested CSP. WordPress plugins, CDNs and external assets may require additional sources.

Match the policy to what Gutenberg loads

A current Gutenberg troubleshooting report shows the browser blocking both a blob worker and a blob frame. WordPress documents that its client-side media pipeline creates a blob worker and requires worker-src to include blob:. MDN explains that worker-src controls Worker sources; without it, browsers fall back through other directives and can ultimately apply default-src.

The editor also uses iframes. Add frame-src 'self' blob: only when the console identifies a required blob frame. Keep frame-ancestors separate: it controls which pages may embed this site, not which frames this page may load.

Correct the header syntax and verify the final response

Permissions Policy header origins use double quotes, as shown in MDN’s allowlist syntax. In Nginx, wrapping the whole value in single quotes lets the origin retain its required double quotes. An entry such as camera=(self 'https://example.com') is malformed.

Run nginx -t, reload Nginx, and inspect the actual editor response in browser developer tools. Nginx add_header inheritance changes when a nested context declares its own headers, so check the final response rather than only the configuration file. Test a report-only policy first on a busy site, confirm the console no longer reports worker or frame violations, then test image upload and save behavior.

Related Web Cheat Sheet guides

Sergey Kornilov

Sergey Kornilov