http.cors Plugin

This feature does not come with Caddy by default. To get it, select the http.cors plugin when you download Caddy.

Supports Cross Origin Resource Sharing headers

Full documentation

Examples

Simple usage

cors

Allows all origins access to all resources

Only allow certain origin domains

cors / http://mytrusteddomain.tld http://myotherdomain.com

Only allow cross-origin requests from a few specific domains

Full config

cors / { origin http://allowedSite.com origin http://anotherSite.org https://anotherSite.org methods POST,PUT allow_credentials false max_age 3600 allowed_headers X-Custom-Header,X-Foobar exposed_headers X-Something-Special,SomethingElse }

Shows examples of all available options

Related Links

Documentation

Access the full documentation for this plugin off-site:

Docs

Plugin Help

Get help from the maintainers of the http.cors plugin:

Support

Plugin Website

Visit http.cors’s website for more information:

Website

Plugin Author: captncraig

Last Updated: 18 Apr 2017, 4:19 PM

This plugin is independent of the Caddy project and is not endorsed or maintained by Caddy developers. Use at your own risk. Do not file issues for this plugin on Caddy’s bug tracker.