<div dir="ltr">The problem is that I have tested the application locally (without nginx) and the uploading works just fine.<div>That's why I think it has something to do with de way nginx is configured.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 6:07 PM, Richard Stanway <span dir="ltr"><<a href="mailto:r1ch+nginx@teamliquid.net" target="_blank">r1ch+nginx@teamliquid.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">"<span style="font-size:12.8px">The response had HTTP status code 503. "</span><div><br></div></span><div>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.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 3:50 PM, Vlad Fulgeanu <span dir="ltr"><<a href="mailto:full.vladd@gmail.com" target="_blank">full.vladd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I added these in "location /upload/preview":<div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">add_header 'Access-Control-Allow-Origin' '<a href="https://test.project.com" target="_blank">https://test.project.com</a>';<br>add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, X-Requested-With, Cache-Control, If-None-Match'; </blockquote><div><br></div><div>And now it gives me:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="https://test.project.com" target="_blank">https://test.project.com</a>' is therefore not allowed access. The response had HTTP status code 503. </blockquote><div><br></div><div>As a response to the actual request (not the pre-flight) </div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 4:27 PM, Richard Stanway <span dir="ltr"><<a href="mailto:r1ch+nginx@teamliquid.net" target="_blank">r1ch+nginx@teamliquid.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Dec 11, 2015 at 1:14 PM, Vlad Fulgeanu <span dir="ltr"><<a href="mailto:full.vladd@gmail.com" target="_blank">full.vladd@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><span style="font-size:13.6px">Hi everyone!</span><div style="font-size:13.6px"><br></div><div style="font-size:13.6px">I am having some trouble setting up nginx for file uploading.</div><div style="font-size:13.6px"><br></div><div style="font-size:13.6px">I am using nginx as a proxy in front of my nodejs server (that has hapi as server framework).</div><div style="font-size:13.6px"><br></div><div style="font-size:13.6px">Here is the nginx.conf file's portion for this server: <a href="http://dpaste.com/0VJKE5K" target="_blank">http://dpaste.com/0VJKE5K</a></div><div style="font-size:13.6px"><br></div><div style="font-size:13.6px">The problem is that I get </div><blockquote class="gmail_quote" style="font-size:13.6px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="https://test.project.com/" target="_blank">https://test.project.com</a>' is therefore not allowed access.<br></blockquote><div style="font-size:13.6px">immediately after sending the pre-flight request when uploading the file.</div><div style="font-size:13.6px"><br></div><div style="font-size:13.6px">Can anyone please help me?</div><div style="font-size:13.6px">Thanks in advance.  </div></div>
<br></div></div>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>