nelmio/cors-bundle

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application

Maintainers

👁 Seldaek

Package info

github.com/nelmio/NelmioCorsBundle

Type:symfony-bundle

pkg:composer/nelmio/cors-bundle

Statistics

Installs: 99 724 949

Dependents: 165

Suggesters: 16

Stars: 1 925

Open Issues: 9

2.6.1 2026-01-12 15:59 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 3d80dbcd5d1eb5f8b20ed5199e1778d44c2e4d1c

apicorscrossdomain


README

About

The NelmioCorsBundle allows you to send Cross-Origin Resource Sharing headers with ACL-style per-URL configuration.

Features

  • Handles CORS preflight OPTIONS requests
  • Adds CORS headers to your responses
  • Configured at the PHP/application level. This is convenient but it also means that any request serving static files and not going through Symfony will not have the CORS headers added, so if you need to serve CORS for static files you probably should rather configure these headers in your web server

Installation

Require the nelmio/cors-bundle package in your composer.json and update your dependencies:

composer require nelmio/cors-bundle

The bundle should be automatically enabled by Symfony Flex. If you don't use Flex, you'll need to enable it manually as explained in the docs.

Usage

See the documentation for usage instructions.

License

Released under the MIT License, see LICENSE.