Grafana dashboard embed cannot be loaded via CURL because of relative paths

Hello, I’m trying to embed Grafana dashboard in my webpage via CURL.

Grafana version: v7.1.0-beta3 (a3a9ce7f24)
HTTP server version: Apache 2.4
My server IP:
Grafana’s server IP:

$ch = curl_init();
$authorization = "Authorization: Bearer <API_KEY>";
    $ch, array( 
    CURLOPT_URL => '',
    CURLOPT_HTTPHEADER => array('Content-Type: application/json' , $authorization),
$output = curl_exec($ch);
echo $output;

Unfortunately this cannot be done because I’m getting a lot of 404 errors, for example:
As you can see it’s trying to load resource from my server, not Grafana’s server.

I’m getting info:

If you're seeing this Grafana has failed to load its application files
1. This could be caused by your reverse proxy settings.
2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath
3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build
4. Sometimes restarting grafana-server can help

I have no problem with CORS because of Apache 2.4 configuration:

a2enmod headers

<Directory /usr/share>
        AllowOverride None
        Require all granted
        Header set Access-Control-Allow-Origin ""
        Header set Access-Control-Allow-Methods "GET, OPTIONS"
        Header set Access-Control-Allow-Headers "origin, authorization, accept"
        Header set Access-Control-Allow-Credentials true