Access to XMLHttpRequest at 'https://www.site2.com/api/get-registered-users-count' from origin 'http://www.site1.com' has been blocked by CORS policy.
Пользовался этой статьей
добавил
location /
{
add_header 'Access-Control-Allow-Origin' 'https://www.site1.com';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Content-Type,Accept';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
}
Тест
После разрешения появились записи
Access-Control-Allow-Origin: https://site1.com
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Accept
Access-Control-Allow-Methods: POST, OPTIONS
Комментариев нет:
Отправить комментарий