Access local resources via OpenVPN

Using OpenWRT 23.05 with next setup:

  1. OpenVPN server on OpenWRT device.
  2. 80 and 443 ports mapped to LAN-device via vOpenWRT port forwarding.
  3. WAN interface with IP accessible via WAN.

So this setup enables me to access web server hosted in LAN throught the internet and to access LAN devices via OpenVPN connection also throught the internet.
All works well.

I'm using domain name to access web and OpenVPN servers.

But when I connected to OpenVPN server I can't access my web server via domain name and can acess it via local IP address (192.168.0.0 network).

Thinking about misroutings but can't solve this problem... Could you help me?

The best solution would be to override the DNS (A/ AAAA) records on your router, pointing to the internal IP of your server under its DNS name. OpenWrt offers this under the DNS settings.

alt, if you own a FQDN, set up an additional FQDN pointing towards the 192.168.0.x IP.

FQ.DN -> public IP
internal.FQ.DN -> 192.168.0.x IP

Ok, but...
When I'm in LAN (wifi/ethernet) I can access my servers via domain name.
Why I can't do it when connected to OpenVPN server?
I'm in "lan" firewall zone when connected to OpenVPN and should act as LAN device.

Does your FQDN resolve to the same IP in both scenarios ?