A
A
arenchilingaryan2021-02-11 21:54:17
Nginx
arenchilingaryan, 2021-02-11 21:54:17

How to solve server request problem?

Hello. Faced trouble. Server requests fail. Throws a CORS error.
I tried to make a request with the help of a postman - everything is good. I looked that it has a default Host header, because of which I cannot make a request. On the back, cors is disabled by this library: https://github.com/fruitcake/laravel-cors

And now to the point? Where to dig? What's wrong? Who has guesses? Maybe a problem with nginx?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Koryukov, 2021-02-11
@arenchilingaryan

CORS is a security built into the browser.
It is the browser that blocks requests to another domain unless CORS headers are configured.
Accordingly, in order for the browser to skip requests, you need to configure CORS on the server.

A
alvvi, 2021-02-12
@alvvi

Apparently, the library was not fully configured with a link to which they gave. In general, nginx has nothing to do with it, most likely, dig in the direction of how back (laravel) handles requests that the browser sends for a cross-domain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question