kian
03/01/2023, 10:13 AMwlp2s0
03/01/2023, 10:15 AMlocation / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
This configuration in nginx solved the issue for us on a local setupelithrar
03/01/2023, 10:15 AM*
has caveats for authenticated requests and is not the same as specifying exact origins.kian
03/01/2023, 10:16 AM204
with appropriate headers is returned if your request matches your CORS configuration, and is only returned in response to a request with the right headers rather than always responding to an OPTIONS
request.kian
03/01/2023, 10:17 AMskaboy007
03/01/2023, 10:53 AMucinteractivesl
03/01/2023, 12:42 PMwlp2s0
03/01/2023, 12:51 PMkian
03/01/2023, 12:57 PMkian
03/01/2023, 12:57 PMkian
03/01/2023, 12:57 PMwlp2s0
03/01/2023, 1:00 PMwlp2s0
03/01/2023, 1:06 PMZeblote
03/01/2023, 1:07 PMZeblote
03/01/2023, 1:08 PMZeblote
03/01/2023, 1:09 PMZeblote
03/01/2023, 1:10 PMskaboy007
03/01/2023, 1:10 PMskaboy007
03/01/2023, 1:13 PMwlp2s0
03/01/2023, 1:14 PMucinteractivesl
03/01/2023, 3:01 PMucinteractivesl
03/01/2023, 3:01 PMkev-ac
03/01/2023, 3:02 PMucinteractivesl
03/01/2023, 3:02 PMkev-ac
03/01/2023, 3:03 PMkev-ac
03/01/2023, 3:04 PMucinteractivesl
03/01/2023, 3:04 PMucinteractivesl
03/01/2023, 3:04 PMkev-ac
03/01/2023, 3:05 PM