Unicode编码方案简介及编码实现
740 2023-04-03 01:36:55
使用ngx_http_headers_module中的add_header 指令,在响应头中添加允许跨域。
Syntax: add_header name value [always];Default: —Context: http, server, location, if in location
add_header Access-Control-Allow-Origin *;add_header Access-Control-Allow-Headers X-Requested-With;add_header Access-Control-Allow-Methods GET,POST;
参考:W3C定义
https://www.w3.org/TR/cors/#access-control-allow-methods-response-header