Canvas button REST query: Cannot call API at Grafana origin

Hello,

I have a button on Grafana (11.0.0) canvas dashboard which is supposed to reach some REST API service. Both Grafana and REST API service deployed on the the same host and sit behind the same nginx proxy.

https://192.168.1.1/grafana - Grafana
https://192.168.1.1/nexus - REST API service

When I configure the following REST endpoint on canvas button…

POST: https://192.168.1.1/nexus/some/rest/service/

…I get the following error: “Cannot call API at Grafana origin”.

I understand that Grafana brutally compares its own origin (https://192.168.1.1) with the service origin and blocks the query. It’s implemented here: https://github.com/grafana/grafana/blob/master/public/app/plugins/panel/canvas/editor/element/utils.ts#L15

The question is how to bypass this check, because it’s a legitimate REST request that shouldn’t be blocked.

Use different origin, e. g. create DNS record for the service, expose service on different IP,…

Sadly, none of that is possible because I don’t control the infrastructure and can’t use different ips, hostnames, or expose service on different port. I already understand that it’s a hard-coded limitation and nothing can be done on Grafana’s side without a PR/bugfix. I solved the issue via Button Panel + Infinity datasource plugins.