A
A
Adel Khalitov2019-05-28 09:08:32
Angular
Adel Khalitov, 2019-05-28 09:08:32

HTTP request error when connecting SSL why?

I’m developing on localhost:3001, on the virtual server the node is launched exactly on 3001. But after downloading the distribution kit to the server, http requests do not go through, they reach if they hit directly to the https://domain.ru domain.
What is it connected with? How to make requests go to 3001 port?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2019-05-28
@search

This is called CORS https://developer.mozilla.org/ru/docs/Web/HTTP/CORS
This can only be fixed on the server side by passing this header: Access-Control-Allow-Origin: domain.ru
With this header you will allow sites on domain.ru to make requests to your server. If the server does not transmit such a header, then the browser itself cuts requests and there is no way to fix this on the client side.
If you do not know in advance on which domain the client will be located, then you can transferAccess-Control-Allow-Origin: *

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question