Access-Control-Allow-Origin Error for jquery $.ajax call

Hi @revant_one,
what if we are running a development server.
from we change nginx.conf file then?
regards

1 Like

Thanks it worked :slight_smile:

Did you solve it? I also have the same issue. I want to get the actual error not the cors.

1 Like

In case you’re using the latest v12 / v13 / develop branch, you can make use of the newly introduced allow_cors site config (documentation).

Still not working. I revised the nginx.conf and also add the allow_cors config on site_config.json.
Still can’t get the error exceptions. Please refer below.

{
 "allow_cors": "https://origin.com/",
 ....
}
1 Like

no need to modify nginx.conf also check the network tab to debug issues…

I noticed that it only works on successful requests or status 200. On the other hand, it will return a CORS error instead of throw exception message. I modified the app.py a bit and add CORS headers on return handle_exception function.

1 Like

Hi
I don’t have “nginx.conf” …

The same cors error pops up in frappe 14. though site_config.json and common_site_config.json contains the “allow_cors”:“*”;

I’m using flutter web to access the rest api of frappe, unfortunately this errors all over again sporadically.

Please suggest how to sort this out!