Handle cors issues

I have found several issues on Grafana’s Github page. However, none of them worked.
I’m using nginx (actually is nginx-proxy by jsonwilder)

What I want to do:

Consume Grafana API from my very own backend/frontend. I’m creating a system that will consume grafana api and load render images from selected dashboard (and panels) and send a e-mail with them.

What issues i’m having:

CORS problem. I can’t consume Grafana API from my backend and from my frontend cuz of cors.

What I’m trying to do:

Using nginx reverse proxy I can’t set the CORS header to enable the communication. However, the reverse proxy seems to be working OK. When I send request to the nginx-proxy, they are redirected to grafana endpoint and everything works.

Howerver, I can’t assure if the header is been setted.

Generic answer (because no exact request/error is provided):

https://enable-cors.org/server_nginx.html

You may need to customize this config - check preflight request what is requested and customize accordingly.