Welcome! Log In Create A New Profile

Advanced

Re: CORS Error

Francis Daly
August 16, 2019 04:04AM
On Wed, Aug 14, 2019 at 10:55:36PM -0400, justcode wrote:

Hi there,

> add_header 'Access-Control-Allow-Origin' '*' always;
> add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS, DELETE';

> ERROR
> invalid number of arguments in "add_header"
>
> CAUSE
> add_header 'Access-Control-Allow-Origin' '*' always;
> when I do add the word "always"

If

add_header 'Access-Control-Allow-Origin' '*' always;

causes stock-nginx to reply "invalid number of arguments", and just
removing the "always" causes nginx to accept the configuration, then (from
http://nginx.org/r/add_header) you probably have nginx older than 1.7.5.

What does

nginx -v

or

nginx -V

say?

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

CORS Error

justcode August 14, 2019 10:55PM

Re: CORS Error

Francis Daly August 16, 2019 04:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 223
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