Panel iframe + configurator + duckdns


I have a problem with panel iframe. I acces to my hassio from my pc (connected to the same router) by ip adress: and i want to do that way because i want to have acces even if internet is offline. So i can define panel iframe by this:

    title: Configurator 
    icon: mdi:wrench 
    url: ""

Of course that wont work when i connect to hassio from outside using duckdns domain

How make it work both way? I mean how to make it connect to local ip when i am connected from pc connected to the same router and make it work on duckdsns domain when i am connected from outside?

I am using duckdns addon with lets encrypt and nginx. I have workaround by acces to addons by clicking Hassio->addons>open web-ui