http.cors Plugin
Supports Cross Origin Resource Sharing headers
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
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.