node.jssslsails.jsdockerdokku

CORS error upload file ~4mb


I'm building an app where angular front-end is on s3 as static website and Sails (0.10.3) API inside dokku with Node 0.11.13 and SSL on EC2. If file is larger than about 4mb I got error "No 'Access-Control-Allow-Origin' header is present on the requested resource." OPTIONS request is hitting my API and I can catch it in customMiddleware but the POST with data is not reaching that far. On front-end side I'm using angularjs-file-upload. If I turn off SSL then it works without any problems but I would prefer to keep it on.


Solution

  • I went up the chain app itself -> dokku -> SSL and the problem was even higher, in nginx.

    nginx.conf required one line more: proxy_read_timeout 1200s;