How to configure cross-domain cors in nginx
This article introduces how to configure cross-domain cors in nginx, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Vhost configuration
Location / {add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Headers DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type; add_header Access-Control-Max-Age 1728000 If ($request_method = OPTIONS) {add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Headers DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type Add_header Access-Control-Max-Age 1728000; return 204;}} so much about how to configure cross-domain cors in nginx. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.