nginx配置前端跨域与预请求options响应
来源:万才科技
|
TAG:温州网站建设万才科技
|
2021.02.16
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'POST,PUT,GET,DELETE';
add_header Access-Control-Allow-Headers 'version, access-token, user-token, Accept, apiAuth, User-Agent, Keep-Alive, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With';
if ($request_method = 'OPTIONS') {
return 204;
}