Your config doesn’t appear to add any Access-Control-Allow-Origin
header,
so unless your backend is adding this, you will need to add an
appropriate Access-Control-Allow-Origin header.
It looks your backend is failing, as it’s returning a HTTP/503 error and
likely not including the correct headers. You should look into why your
backed is returning a 503 as this doesn’t seem like an nginx issue any
more.
The problem is that I have tested the application locally (without
nginx)
and the uploading works just fine.
That’s why I think it has something to do with de way nginx is
configured.
I managed to make some changes (I was using another config file,
although “nginx -t” was showing the correct file, witch is very
strange) and I don’t get HTTP 503 back.
The config file now looks like this: http://dpaste.com/18J54VV
The problem I have now is that I get
500 (Internal Server Error)
as a response to the POST request.
I can see that the files are actually uploaded to
“/home/project/previews/uploaded-files”, but for whatever reason they
don’t get passed to the backend server, because the backend doesn’t
log anything (though it says that it’s an Internal Server Error).
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.