Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
June 10, 2014 07:34AM
Hello!

On Mon, Jun 09, 2014 at 04:35:31PM +0530, Srirang Doddihal wrote:

> 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?

Quote from http://nginx.org/r/add_header:

"Adds the specified field to a response header provided that the
response code equals 200, 201, 204, 206, 301, 302, 303, 304, or
307."

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

Srirang Doddihal June 09, 2014 07:06AM

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

Maxim Dounin June 10, 2014 07:34AM

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

ensing July 15, 2014 01:37PM

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

Maxim Dounin July 15, 2014 06:22PM

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

manimalcruelty August 21, 2015 01:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 187
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready