Access to my server with two virtual hosts from within the LAN

Hi all,
I am using openwrt for some days and currently I am trying to solve one issue with accessing my web server from the local LAN. On my web server I have two virtual hosts - nextcloud and web page and after some digging in internet I managed to set the local access to the nextcloud but not to the web page.
It have the following setup:
LAMP server with static IP address 192.168.0.80, which hosts nextcloud and web page
HTTPS and WAN access is working fine, including the 443 and 80 port forwarding.
The server is being accessed from internet on the following addresses:
mydomain - web page
cloud.mydomain - nextcloud

With openwrt I tried to set the access from the LAN over the public addresses, which works partially. What I did was to set up in Network / Hostnames:
mydomain - 192.168.0.80
cloud.mydomain - 192.168.0.80

With this setup I can access nextcloud with < cloud.mydomain > but when I try < mydomain > I get to the openwrt login and not to the web page.
What could be wrong here? Is it something to do with the fact that one is domain and the other is subdomain?

Sounds like you’d need to either change the webport on openwrt , or change the web port on your cloud server . From the internet , your public ip and port 80 (or 443) can only go to one place.

Does 'ping cloud.mydomain' give the same ip address as 'ping mydomain'? If not, something is wrong with your DNS. If yes, try to clear your browsers cache.

2 Likes

Thanks mates for your quick answers :grinning:
Mijzelf, I marked your answer as solution because it turned out that it was the browser (Chromium) cache. I did also "Reset to defaults" of the openwrt, just to be on the safe side.
In fact I had got the "cache issue" already before but realized just now. It was when I set up the openwrt LAN IP to 192.168.0.1, what was actually my old router IP. Because I access it from two devices, one's browser was complaining that the site is not available while the other was fine.

1 Like