L
L
lemonlimelike2017-10-10 20:57:00
Nginx
lemonlimelike, 2017-10-10 20:57:00

Why does the No 'Access-Control-Allow-Origin' header is present... error occur?

An error occurred 59dd097a29207122487073.jpeg
They said that you need to add the following lines to the nginx.conf configuration file

server{
    location ~* \.(mp4|avi)$ {
        add_header Access-Control-Allow-Origin *;
    }
}

I added it, but it still shows up. What to do?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zoozag, 2017-10-10
@lemonlimelike

This happens when you insert someone else's content through an iframe. Accordingly add_header Access-Control-Allow-Origin *; should not be registered with you, but on the source

Z
Zakharov Alexander, 2017-10-10
@AlexZaharow

This article helped me at one time:
https://learn.javascript.ru/xhr-crossdomain
One heading "Access-Control-Allow-Origin" was not enough to remember.

V
Vladimir Mukovoz, 2017-10-11
@castomi

I'm shocked)
Read the documentation, those who understand something about this have already stopped answering you))
nginx.org/ru/docs/http/request_processing.html
You will read this and you will understand why your example from the question does not work)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question