U
U
Urbansamurai2016-09-30 17:12:54
JavaScript
Urbansamurai, 2016-09-30 17:12:54

How to enable CORS on cross-domain $.get request to public storage?

Hey!

The situation is such that the frontend part of the site is on one computer of the local network, and the backend is on the other. I managed to set up CORS for requests specified in Laravel routes, but when I try to make a get request for a file from storage on another computer, it gives an error:

XMLHttpRequest cannot load 192.168.1.37:8000/storage/icons/rain.svg . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' 127.0.0.1:8887 ' is therefore not allowed access.


Tried to enable cors support in .htaccess - didn't help. Edited Apache config - same thing.

Pliz, help me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
Urbansamurai, 2016-09-30
@Urbansamurai

Decision

A
Alexey, 2016-09-30
@alsopub

If apache is installed on 192.168.1.37, then try adding it to .htaccess Header set Access-Control-Allow-Origin *so that the appropriate header appears in the response, allowing requests. Or have you already done that? Has the title appeared?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question