Заголовок 'Access-Control-Allow-Origin' не публикуется из проекта django
Я получаю доступ к проекту django
на Enginx-unit с другого сервера ReatJS
У меня ошибка, как показано ниже.
Access to XMLHttpRequest at 'https://api.example.net:8008/upload/' from origin 'https://example.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Я тестировал curl -H "origin example.net" --verbose https://api.example.net:8008
показывает журнал.
> GET / HTTP/1.1
> Host: api.example.net:8008
> User-Agent: curl/7.71.1
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< X-Frame-Options: DENY
< Content-Length: 402
< X-Content-Type-Options: nosniff
< Referrer-Policy: same-origin
< Vary: Origin
< Server: Unit/1.25.0
< Date: Sun, 07 Nov 2021 09:44:43 GMT
<
Полагаю, что он не включает Access-Control-Allow-Origin
заголовок.
Я уже настроил django-cors-headers и в моем settings.py
CORS_ALLOWED_ORIGINS = [
'https://example.net'
]
CORS_ALLOW_ALL_ORIGINS = True
Есть ли что-нибудь, что я могу проверить?