How to set up nginx for file uploading

Vlad Fulgeanu full.vladd at gmail.com
Sat Dec 12 17:11:06 UTC 2015


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.

On Fri, Dec 11, 2015 at 6:07 PM, Richard Stanway <r1ch+nginx at teamliquid.net>
wrote:

> "The response had HTTP status code 503. "
>
> 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.
>
> On Fri, Dec 11, 2015 at 3:50 PM, Vlad Fulgeanu <full.vladd at gmail.com>
> wrote:
>
>> I added these in "location /upload/preview":
>>
>> add_header 'Access-Control-Allow-Origin' 'https://test.project.com';
>>> add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type,
>>> X-Requested-With, Cache-Control, If-None-Match';
>>
>>
>> And now it gives me:
>>
>> No 'Access-Control-Allow-Origin' header is present on the requested
>>> resource. Origin 'https://test.project.com' is therefore not allowed
>>> access. The response had HTTP status code 503.
>>
>>
>> As a response to the actual request (not the pre-flight)
>>
>> On Fri, Dec 11, 2015 at 4:27 PM, Richard Stanway <
>> r1ch+nginx at teamliquid.net> wrote:
>>
>>> 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.
>>>
>>> On Fri, Dec 11, 2015 at 1:14 PM, Vlad Fulgeanu <full.vladd at gmail.com>
>>> wrote:
>>>
>>>> Hi everyone!
>>>>
>>>> I am having some trouble setting up nginx for file uploading.
>>>>
>>>> I am using nginx as a proxy in front of my nodejs server (that has hapi
>>>> as server framework).
>>>>
>>>> Here is the nginx.conf file's portion for this server:
>>>> http://dpaste.com/0VJKE5K
>>>>
>>>> The problem is that I get
>>>>
>>>>> No 'Access-Control-Allow-Origin' header is present on the requested
>>>>> resource. Origin 'https://test.project.com' is therefore not allowed
>>>>> access.
>>>>>
>>>> immediately after sending the pre-flight request when uploading the
>>>> file.
>>>>
>>>> Can anyone please help me?
>>>> Thanks in advance.
>>>>
>>>> _______________________________________________
>>>> nginx mailing list
>>>> nginx at nginx.org
>>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>>
>>>
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx at nginx.org
>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20151212/00018a4a/attachment.html>


More information about the nginx mailing list