I have setup a Wireguard VPN on my raspberry pi and I can connect to it via client app on my mobile phone. I can access the internet though the phone and I confirm that the phone is using the same IP of the raspberry pi, so the VPN is working for the outer internet.
But I have a local webserver on my Pi, which I can access on the pi using a direct internal IP (192.168.1.50), using raspberrypi.local hostname, or by using a custom host defined in /etc/hosts file.
However, in the phone and over VPN I can only access that local webserver over the internal IP: raspberrypi.local or any other hostname defined in /etc/hosts does not work.
How can I resolve this?