# Embed (iframe) v2.12 PMM panels

**URL:** <https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428>\
**Category:** PMM 2.x\
**Created:** [December 22, 2020, 8:09am UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428 "2020-12-22T08:09:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean225](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sean225](https://forums.percona.com/u/Sean225)\
**Post date:** [December 22, 2020, 8:09am UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/1 "2020-12-22T08:09:56Z")

</div>

I am trying to get some panels to embed in a htm page hosted on another server. I am using the docker version 2.12 and have already changed the setting to allow embed (allow\_embedding: true).

The panel just shows up as “ **192.168.2.110** refused to connect”. It is first seeing this error that lead me to the settings change to allow embedding in Grafana.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [December 22, 2020, 11:15am UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/2 "2020-12-22T11:15:45Z")

</div>

Hi Sean,

I could find only one way to make iframe works. It’s disabling authentication for dashboards viewing.

![Screenshot_20201222_164728.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/224963a4406c97aca7e225dadac161ddae2b2de1.png)

 ![Screenshot_20201222_184524.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/4dbfce2b5a15905e79ded8e9236504b8b8d74080.png)

---

<div class="post-metadata">

**Author:** ![ademidoff](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ademidoff/32/14234_2.png) [@ademidoff](https://forums.percona.com/u/ademidoff)\
**Post date:** [December 22, 2020, 11:21am UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/3 "2020-12-22T11:21:05Z")

</div>

Hi @Sean225 ,

could you post your html code from `<b>Panel->Share-> Embed</b>`?

Also, did you restart grafana (or PMM) after applying the changes to grafana.ini?

---

<div class="post-metadata">

**Author:** ![Sean225](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sean225](https://forums.percona.com/u/Sean225)\
**Post date:** [December 22, 2020, 11:58am UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/4 "2020-12-22T11:58:12Z")

</div>

These are the current settings on the server;

#################################### Anonymous Auth ######################

[auth.anonymous]

# enable anonymous access

enabled = true

cookie\_secure = true

cookie\_samesite = none

allow\_embedding = true

Within the iframe:

src="[https://192.168.2.110/graph/d-solo/node-memory/memory-details?orgId=1&from=1608614356260&to=1608657556260&refresh=1m&](https://192.168.2.110/graph/d-solo/node-memory/memory-details?orgId=1&from=1608614356260&to=1608657556260&refresh=1m&)

var-interval=$\_\_auto\_interval\_interval&

var-node\_name=db1&var-service\_name=All&

var-environment=All&

var-cluster=All&

var-replication\_set=All&

var-database=All&

var-node\_type=All&

var-service\_type=All&

var-username=All&

var-schema=All&panelId=78" width=“450” height=“200” frameborder=“0”\>

The webserver that hosts the test.htm page is Apache and SSL, and PMM is running with SSL. From CLI on a random server I can use “curl -k …” and the panel will load the page (though obviously unviewable). The site that hosts the HTML pages is HTTPS only, so the embed links thus have to be as well.

---

<div class="post-metadata">

**Author:** ![Sean225](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sean225](https://forums.percona.com/u/Sean225)\
**Post date:** [December 22, 2020, 12:53pm UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/5 "2020-12-22T12:53:42Z")

</div>

BTW, I have been editing /etc/grafana/grafana.ini and within PMM\>Admin\>Settings it is listed as allowing embed. Which would make me think I am editing the correct ini file. However within Chrome’s dev tools I see this:

Refused to display … in a frame because it set ‘X-Frame-Options’ to ‘deny’

Which leads me to think that something else is still blocking or not allowing the panels to be embedded. Also I just want to mention the host server contains a collection of web pages that are embedding to other HTTPS servers.

---

<div class="post-metadata">

**Author:** ![ademidoff](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ademidoff/32/14234_2.png) [@ademidoff](https://forums.percona.com/u/ademidoff)\
**Post date:** [December 22, 2020, 12:59pm UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/6 "2020-12-22T12:59:55Z")

</div>

If you can successfully curl the panel from outside PMM, then the problem must be elsewhere. Maybe your apache config or something…

I wonder whether you can curl the panel from the the very Apache server?

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [December 22, 2020, 1:52pm UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/7 "2020-12-22T13:52:17Z")

</div>

The header is added by nginx for security reasons.

You could use [chrome extension “iFrame Allow”](https://chrome.google.com/webstore/detail/iframe-allow/gifgpciglhhpmeefjdmlpboipkibhbjg)

or allow the header in nginx configuration file

 ![Screenshot_20201222_212102.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/e5576dd135d095ae221da3f63f036db503582b71.png)

---

<div class="post-metadata">

**Author:** ![Sean225](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sean225](https://forums.percona.com/u/Sean225)\
**Post date:** [December 22, 2020, 1:52pm UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/8 "2020-12-22T13:52:58Z")

</div>

I found the problem, it had nothing to do with Grafana, but within NGINX. In the config file pmm-ssl.conf it had the line “add\_header X-Frame-Options DENY;”. I was looking at the wrong source.

For anyone else looking to embed panel within HTTPS site, here is your answer. Besides settings within Grafana.ini you need to set in /etc/nginx/conf.d/pmm-ssl.conf the X-Frame settings

---

<div class="post-metadata">

**Author:** ![Zoloholic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/zoloholic/32/22134_2.png) [@Zoloholic](https://forums.percona.com/u/Zoloholic)\
**Post date:** [September 18, 2025, 3:47pm UTC](https://forums.percona.com/t/embed-iframe-v2-12-pmm-panels/8428/9 "2025-09-18T15:47:03Z")

</div>

If anyone is interested, here’s how I did it in minikube using Traefik ingress routes.

Note: “allow\_embedding = true” should be set in grafana.ini or as a global env in the pod.

```auto
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: pmm
  namespace: pmm
spec:
  entryPoints:
    - web
    - websecure
  routes:
    - match: Host(`pmm.localhost`)
      kind: Rule
      services:
        - name: pmm
          port: 80
      middlewares:
        - name: embedding-pmm
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: embedding-pmm
  namespace: pmm
spec:
  headers:
    frameDeny: false
    customFrameOptionsValue: "ALLOW-FROM https://my-server.localhost:8443"
    contentSecurityPolicy: "frame-ancestors https://my-server.localhost:8443;"

```
