0

I am using Apache 2.4, on Debian 9.

I can access all my subdomains from my mobile phone.

However on my local network, from separate clients (windows 8, Debian (not the server), and Mac OS 10.10), from different browsers (Firefox, Chrome, Brave), I get mixed results. One subdomain doesn't load at all (nextcloud), but I guess that is specific to nextcloud.

Just perlpexes me, that I can reach all of them from my phone, and weird behavior on local network.

Anyone able to offer a tip on how I can resolve this??

UPDATED: Thanks for the immediate replies.

I have to admit, a "hairpin NAT" is outside of my scope of knowledge. I am not using a NAT. I do have a local DNS server running (Pihole), but that doesn't seem to be a factor, since it affects machines with it (and those without Pihole configured to be used as it's dns server). So, I do not think that is a factor.

Also, don't think it's a browser, OS issue, because I just failed on two configurations (Windows/Mac), jumped on my VPN (outside location), and everything worked (was served) as expected.

I am starting to narrow down that one of my virtualHosts is figured incorrectly. I have one setup to work as a ReverseProxy, per a tutorial (so I can run gitlab from apache, instead of nginx--nginx is disabled). From what I read about ReverseProxy's, I don't know exactly why we would need one? But, ok. Here is virtualHost file.

virtualHost file

1 Answers1

0

Thanks for the help.

It was related to NAT loopback/hairpin NAT. I had never heard of that, or experienced it. More specifically, it was caused by Pihole. I failed to recognize it, because some webpages were still being cached.

To solve the problem:
1. %sudo touch /etc/dnsmasq.d/20-customhosts.conf
2. %sudo (your favorite text editor) /etc/dnsmasq.d/20-customhosts.conf
3. #added the following
# use following format: address=/domain/ip address
#x represents server local ip

address=/mysite1.com/192.168.1.x
address=/subdomain.mysite1.com/192.168.1.x
address=/subdomain2.mysite1.com/192.168.1.x

(save and quit) 4.%sudo service dnsmasq restart

All of this I found from a reddit post: https://www.reddit.com/r/pihole/comments/5dkagt/pi_hole_doesnt_resolve_local_ip_addresses_ddns/