Client script ajax request generate CORS problem

I’m referring to this example: https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/client-scripts/custom-button

The example is not working because of this error:

Access to XMLHttpRequest at ‘https://example.com/just-do-it’ 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”:“https://example.com
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.

Thanks