CORS headers not being set for a 401 response from upstream.

Srirang Doddihal om.brahmana at gmail.com
Mon Jun 9 11:05:31 UTC 2014


Hi,

I am trying to setup CORS headers in my nginx config. My config is here :
http://pastie.org/private/eevpeyy6uwu25rl5qsgzyq

The upstream is defined separately.

It responds fine to OPTIONS request. It also adds the
"Access-Control-Allow-Origin *" header to responses from the upstream
(pm_puma_cluster) when the response status is 200.

But if the response status from the upstream is 401 it is not adding the
CORS header.

Is it expected? Or am I missing something in the config?

P.S : The upstream is a Rails app and I would prefer to deal with the CORS
headers in the nginx and not mess with them in the Rails app.

-- 
Regards,
Srirang G Doddihal
Brahmana.

The LIGHT shows the way.
The WISE see it.
The BRAVE walk it.
The PERSISTENT endure and complete it.

I want to do it all ALONE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140609/004daa7c/attachment.html>


More information about the nginx mailing list