How to Enable CORS in Nginx

How to Enable CORS in Nginx

Nginx

Here is an example to allow origin https://geekflare.dev. Add the following in the server block of nginx.conf or in-use configuration file.

add_header Access-Control-Allow-Origin "https://geekflare.dev";
设置