fix: nginx配置文件修改,解决跨域问题。
This commit is contained in:
@@ -105,7 +105,6 @@ http {
|
||||
add_header Access-Control-Allow-Origin * always; # 你的前端源站,必须指定具体地址(比*安全)
|
||||
add_header Access-Control-Allow-Methods 'GET,POST,PUT,DELETE,OPTIONS' always; # 允许前端的请求方法
|
||||
add_header Access-Control-Allow-Headers 'Content-Type,Authorization,Token,X-Requested-With' always; # 允许前端的自定义请求头(根据实际需求补充)
|
||||
; add_header Access-Control-Allow-Credentials true always; # 允许跨域携带Cookie/Token(登录必备)
|
||||
add_header Access-Control-Max-Age 3600 always; # 预检请求缓存时间(1小时,减少OPTIONS请求)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user