CORS doesn't work despite headers set CORS doesn't work despite headers set nginx nginx

CORS doesn't work despite headers set


The problem turned out to be Nginx not accepting large files. Placing this in the location block of my nginx server config solved my issue: client_max_body_size 10M;


Issue is probably not with nginx since it's only a mobile issue. Try Using, instead of * for Access-Control-Allow-Origin you can use your origin as well.

app.use(function(req, res, next) {    res.header("Access-Control-Allow-Origin", "*");    res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");    res.header("Authorization", "Access-Control-Allow-Headers", "Origin","X-Requested-With", "Content-Type", "Accept");    next();});

UPDATE

Try following if above does not work, this enables everything for the time being.

app.use(cors());