[英]Blocked by CORS policy: No 'Access-Control-Allow-Origin'. The backend has set the relevant header or the same
Only appears when uploading larger files, no problem when connecting to a file server in the LAN(not localhost).仅在上传较大文件时出现,连接到局域网中的文件服务器(不是本地主机)时没有问题。
Req:要求:
Error with this request:此请求出错:
This is right, the difference is just the file size.没错,区别只是文件大小。
Resp:回复:
Access-Control-Allow-Method = [POST]
Access-Control-Allow-Headers = [x-requested-with]
Access-Control-Allow-Credentials = [true]
Access-Control-Allow-Origin = [http://localhost:3000]
The default limit size of nginx is within 1M. nginx的默认限制大小在1M以内。 add this config:添加此配置:
client_max_body_size xM
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.