nelmio/NelmioCorsBundle

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

PHP

1,925

198 commits

updated Jan 14, 2026

See the code

README

NelmioCorsBundle

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.

bundle
cors
cors-request
cross-origin-resource-sharing
php
symfony
symfony-bundle

nelmio/NelmioCorsBundle

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

PHP

1,925

198 commits

updated Jan 14, 2026

See the code

README

NelmioCorsBundle

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.

bundle
cors
cors-request
cross-origin-resource-sharing
php
symfony
symfony-bundle

Project health

Overall

3.6/10

Maintained

0/10

Code review

5/10
OpenSSF Scorecard

Significant stargazers

Christophe Coevoet

2,144 followers · starred Nov 2011

Derick Rethans

1,840 followers · starred Feb 2021

Yonel Ceruto

267 followers · starred Oct 2023

Frank de Jonge

1,145 followers · starred Mar 2018