B
B
baraban12342021-12-01 16:52:34
Nginx
baraban1234, 2021-12-01 16:52:34

Get error: (CORS) Response to preflight request doesn't pass access control check: It does not have HTTP ok status. How to get rid of it?

Hello colleagues!

I've been fiddling with this error for a long time and no solution has been found on the Internet. After trying all the recommendations, I decided to contact here, maybe someone faced a similar problem.

VPS virtual machine, nginx server and nuxt.js framework

When axios get request to a third party service, the following console error occurs:
Access to XMLHttpRequest at ' https://**** ' from origin ' https://**** ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

in nginx config I inserted all add_header and OPTIONS 's, just everything-everything - zero result.
Headings when sending too changed - failure however.

Answer screen:

61a77b8e91fc7546228129.png

Connoisseurs, I will be grateful for any hint in this ailment.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-12-01
@karabanov

Here's a CORS tip for dummies: history, how to...
And here's more with examples of enable cross-origin resource sharing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question