How to Enable CORS in Caddy 2

Can I get an example of enabling CORS in Caddy 2?

As for example that we use to do on nginx like:

Access-Control-Allow-Origin *


CORS is basically responding with particular headers to requests coming from a different origin, or referrer, and to respond properly to pre-flight requests, which are made with the OPTIONS HTTP method. What have you tried so far? What is your Caddyfile?


This topic was automatically closed after 30 days. New replies are no longer allowed.