Re: CORS Error

2019-08-16 Thread Francis Daly
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 Dalyfran...@daoine.org
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


CORS Error

2019-08-14 Thread justcode
Here is the code: 

location ~ \.php$ { 
include snippets/fastcgi-php.conf; 
include fastcgi_params; 
fastcgi_pass unix:/run/php/php7.2-fpm.sock; 
fastcgi_param SCRIPT_FILENAME /var/www/test/public$fastcgi_script_name; 

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

add_header 'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-

Control,Content-Type,Content-Range,Range,Authorization'; 
} 


ERROR 
invalid number of arguments in "add_header" 

CAUSE 
add_header 'Access-Control-Allow-Origin' '*' always; 
when I do add the word "always"

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,285289,285289#msg-285289

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx