Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: Marko on December 24, 2020, 12:12:17 AM

Title: CORS Missing Allow Origin
Post by: Marko on December 24, 2020, 12:12:17 AM
Hello
I have using Nginx & Varnish & Apache but can't find solution to fix CORS problem.
I have add in apache vhosts
Code: [Select]
Header set Access-Control-Allow-Origin "*"
In nginx vhosts config
Code: [Select]
add_header 'Access-Control-Allow-Origin' '*';
In php script

Code: [Select]
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true"

What i'm missing, where can be problem and why i have "CORS Missing Allow Origin" error constantly?
Title: Re: CORS Missing Allow Origin
Post by: Sandeep on December 24, 2020, 05:55:24 AM
you need to add cors for nginx too. Create a custom template for it.
Title: Re: CORS Missing Allow Origin
Post by: Marko on December 24, 2020, 02:22:01 PM
Already added but problem was line in apache config, after removing all working fine. So header added in nginx and php only.