Server shows outside local network through vhost

Hello,

I installed Plex as a media frontend for my Owncloud installation on a debian vm that runs on an UnRAID host inside my local network and it works like a charm. Now I configured apache so that i can use plex.example.com, which is redirected to https://plex.example.com/web instead of ip:32400/web.
This works as well, the problem i face though is that if I connect to my plex server using plex.example.com it shows as outside of my local network, while it works fine with connecting over the local ip. This is bad because I have multiple devices that are in - and outside my network and I want the speed benefit of being inside when I am at home, so how can I fix it?

Leave out the apache stuff and the idea to use an own domain. It is not necessary and only intruduces serious security issues as you’ve found out.
PMS brings everything already with it. You don’t need to mind about a DynDNS service or anything like that. Just install it and connect it to your private network.
Then establish a portforwarding in your router to your plex machine and that’s it.
https://support.plex.tv/hc/en-us/articles/200484543-Enabling-Remote-Access-for-a-Server

Internal clients will recognise that the server is reachable on its private IP address and thus will use the quality settings for local networks.
External clients will automatically get informed by plex.tv about the public IP:port of your server and will be able to communicate with it, including end-to-end encryption.