# Display Pi-hole via iFrame in Home Assistant

**URL:** https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509
**Category:** General
**Created:** [February 24, 2018, 2:05pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509 "2018-02-24T14:05:11Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Raoul\_Teeuwen](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/raoul_teeuwen/32/2902_2.png) [@Raoul\_Teeuwen](https://discourse.pi-hole.net/u/Raoul_Teeuwen)
#### Post date: [February 24, 2018, 2:05pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/1 "2018-02-24T14:05:11Z")

</div>

Hello. With my very basic unix skills i'm trying to display Pi-hole via an iFrame in Home Assistant. When i add code to do this and click the tab in Home Assistant (HA), i get "[ERROR]: Unable to parse results from queryads.php: Unhandled error message ()" shown in HA.

What i understood is that the code that prevents using iFrame is ""X-Frame-Options" =\> "DENY"" in /etc/lighttpd/lighttpd.conf ([https://www.reddit.com/r/pihole/comments/6ock0s/cant\_get\_the\_pihole\_dashboard\_to\_display\_in\_an/](https://www.reddit.com/r/pihole/comments/6ock0s/cant_get_the_pihole_dashboard_to_display_in_an/)).

Since that file gets overwitten when pi-hole is updated (?), i read i should put some code in external.conf. I've now created that file with the following code

"  
setenv.add-response-header = (  
"X-Pi-hole" =\> "The Pi-hole Web interface is working!",  
"X-Frame-Options" =\> "ALLOW"  
)

"  
But still get the error.

---

<div class="post-metadata">

### Author: ![Mcat12](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/mcat12/32/20_2.png) [@Mcat12](https://discourse.pi-hole.net/u/Mcat12)
#### Post date: [February 26, 2018, 2:32pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/2 "2018-02-26T14:32:35Z")

</div>

See here for the lighttpd docs: [https://redmine.lighttpd.net/projects/1/wiki/Docs\_ModSetEnv](https://redmine.lighttpd.net/projects/1/wiki/Docs_ModSetEnv)

You probably have to use the `setenv.set-*` version of the command.

---

<div class="post-metadata">

### Author: ![Raoul\_Teeuwen](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/raoul_teeuwen/32/2902_2.png) [@Raoul\_Teeuwen](https://discourse.pi-hole.net/u/Raoul_Teeuwen)
#### Post date: [February 26, 2018, 6:15pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/3 "2018-02-26T18:15:58Z")

</div>

Thank you. Changed _add_ to _set_. The page with the iframe still reports

```
x Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
3 pihole:1 Refused to display 'http://192.168.1.134:8093/admin/' in a frame because it set 'X-Frame-Options' to 'deny'.

```

So my attempt to override in external.conf doesn't seem to work yet. I'll keep on digging.

---

<div class="post-metadata">

### Author: ![Raoul\_Teeuwen](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/raoul_teeuwen/32/2902_2.png) [@Raoul\_Teeuwen](https://discourse.pi-hole.net/u/Raoul_Teeuwen)
#### Post date: [February 26, 2018, 9:45pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/4 "2018-02-26T21:45:41Z")

</div>

For now i've decided to edit /etc/lighttpd/lighttpd.conf and change DENY to ALLOW. This works

---

<div class="post-metadata">

### Author: ![xspyboyx](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/xspyboyx/32/24842_2.png) [@xspyboyx](https://discourse.pi-hole.net/u/xspyboyx)
#### Post date: [April 17, 2021, 11:20pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/5 "2021-04-17T23:20:23Z")

</div>

Anything else you changed? I changed this and then rebooted but still getting the white page in HA. Thanks

---

<div class="post-metadata">

### Author: ![vdbrink](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/vdbrink/32/24878_2.png) [@vdbrink](https://discourse.pi-hole.net/u/vdbrink)
#### Post date: [April 18, 2021, 3:51pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/6 "2021-04-18T15:51:23Z")

</div>

I tested it yesterday also and it didn't work for me neither with Web Interface 5.5

Fixed: the path was incorrect. It should be:

> -/my-external.conf:/etc/lighttpd/external.conf

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 3, 2021, 3:47am UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/8 "2021-05-03T03:47:17Z")

</div>

Don't execute commands or edit files inside the running docker container. Any edits you make will very likely not persist across container starts or image updates.

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 6, 2021, 4:41pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/13 "2021-05-06T16:41:24Z")

</div>

> [@gavinops](#):
>
> back on alt acc

We don't allow alt accounts here. I'll delete this one and you can use your first one.

---

<div class="post-metadata">

### Author: ![Gavin123-code](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/gavin123-code/32/25106_2.png) [@Gavin123-code](https://discourse.pi-hole.net/u/Gavin123-code)
#### Post date: [May 8, 2021, 3:13pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/14 "2021-05-08T15:13:26Z")

</div>

But still tho HOW DO YOU DO THIS ON DOCKER?!

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 8, 2021, 3:14pm UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/15 "2021-05-08T15:14:02Z")

</div>

I DON'T KNOW!!!

---

<div class="post-metadata">

### Author: ![Duane\_McKibbin](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/duane_mckibbin/32/34757_2.png) [@Duane\_McKibbin](https://discourse.pi-hole.net/u/Duane_McKibbin)
#### Post date: [February 3, 2023, 8:05am UTC](https://discourse.pi-hole.net/t/display-pi-hole-via-iframe-in-home-assistant/7509/17 "2023-02-03T08:05:35Z")

</div>

I've managed to get my PiHole login page displaying in an iFrame (removed the X-Frame-Options header in nginx) but I am not able to log in. Entering a password just keeps sending me back to the login page. Everything works fine outside of the iFrame. Any ideas?
