在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
nginx 配置: header_filter_by_lua_file cros.lua; access_by_lua ' if ngx.var.request_method == "OPTIONS" then return 203 end ';
cros.lua: if string.find(ngx.var.http_origin,":8008") then //判断request的origin ngx.header["Access-Control-Allow-Credentials"] = "true" ngx.header["Access-Control-Allow-Origin"] = ngx.var.http_origin ngx.header["Access-Control-Allow-Headers"] = "x-requested-with,content-type" if ngx.var.request_method == "OPTIONS" then ngx.header["Access-Control-Max-Age"] = "86400" ngx.header["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS, DELETE" ngx.header["Content-Length"] = "0" ngx.header["Content-Type"] = "text/plain, charset=utf-8" end
|
请发表评论