Php code nnot working in iframe

Hi I used some very basic php code and it is not displayed if I use iframe.
<?php echo 'TEST'; ?>

It is working if I access my HA with hostname but if local ip is used it is not resolving php code.

This is my card config.

type: custom:config-template-card
  - null
  type: iframe
  title: null
  allow_open_top_navigation: true

So if I replace IP in url with hostname it works. Very strange, any clue?

Does it work in a plain browser with
If not, the problem is unrelated to HA…

Of course it is working, as well with hostname it works.

Well, anyway, an iframe is between your browser and your php server.
Did you try with an iframe out of HA context?

1 Like

Just tested and it is working out of HA context.

I created a new website under and added iframe pointing to

My HA is running under but if I open HA with then it works.

I just figured it our, if I add Header unset X-Content-Type-Options in my apache config it is working now.