Allow CORS headers

Hi,

I’m trying to retrieve some data through AJAX, from a remote website. However, it doesn’t work because of CORS policies.

I’m really uneducated in changing server configurations. I tried some things that I found on the internet, but most of the time after restarting the site, it didn’t start up anymore.

Please tell me how to change the configuration in Local 5.2.5 with nginx.

CORS headers needs to be implemented on the remote server, not in Local. It sounds like your browser is blocking the remote, since the remote hasn’t granted it access.

I’m only familiar with implementing CORS to allow fonts to be loaded cross-domain, so I won’t give specific instructions in case they’re not relevant to your situation, but basically the AJAX response returned by the remote server needs to have the appropriate Access-Control-Allow-Origin header.

I don’t think you are completely right, but I could as well be wrong.

This is the error message:
“Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://[REDACTED]. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).”

This error message tells me this is the policy of the local environment, not the remote one. Correct?

The error message is telling you that the Access-Control-Allow-Origin is missing from the requested resource. Assuming that you see this message when trying to pull data from the remote server, then the remote server is where the header needs to be added.

This error message tells me this is the policy of the local environment, not the remote one. Correct?

The Same Origin Policy, as I understand it, is a browser security policy that controls whether websites and applications can access each others data. So the policy that the error message refers to is your web browser’s policy.

Hmm… OK. Then I misinterpreted the error message.

However, I’m unsure how to add a Local environment to the remote environment. Should I ask for adding the IP address of my internet connection? Or the domain name of the Local environment? Something else?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.