Home > Net >  Blocked by CORS policy: No 'Access-Control-Allow-Origin'. The backend has set the relevant
Blocked by CORS policy: No 'Access-Control-Allow-Origin'. The backend has set the relevant

Time:01-13

enter image description here

Only appears when uploading larger files, no problem when connecting to a file server in the LAN(not localhost).

Req:

Error with this request: enter image description here

This is right, the difference is just the file size. enter image description here

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]

CodePudding user response:

The default limit size of nginx is within 1M. add this config:

client_max_body_size xM
  •  Tags:  
  • Related