A
A
Alexey Yarkov2017-02-06 19:43:51
Nginx
Alexey Yarkov, 2017-02-06 19:43:51

How to overcome Access-Control-Allow-Origin error on server response 400?

The server is written in express. In front of it is Nginx. Requests go from the main domain to the api.domain.ru subdomain.
If the server does not respond with 200, then an error occurs:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://domain.ru' is therefore not allowed access. The response had HTTP status code 401.

And the server cannot respond differently to erroneous requests))) How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2017-02-06
@yarkov

Answer found here: serverfault.com/a/700670

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question