Client script ajax request generate CORS problem

I’m referring to this example: Add a Custom Button

The example is not working because of this error:

Access to XMLHttpRequest at ‘’ from origin ‘https://************’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

I added the option “allow_cors”:“
to my site_config.json and then I did a bench restart but nothing works.

What should I try? I’m not sure if I need to go play in the nginx settings?

When it will be working, I’ll update the erpnext documentation.