I have a Debian 10 server where I have installed Apache2. I have a domain, let's call it mydomain.com, pointing to my public IP address. The server runs fine, as I can access it with no problems using mydomain.com outside of my local network. However, when I try to access it using mydomain.com within the local network where the server runs, I either get a timeout or ERR_CONNECTION_RESET from the browser. If I type in the server's local IP address in the address bar, I reach the server fine, as I'm greeted by Apache2's default page, so it's only a problem when I use mydomain.com inside the network.
I have other services running on that server, which work fine, so it must be a problem with Apache2. For example, I have a Plex server running, and I can access it using mydomain.com:32400 with no problems. I also have a Nodejs server, which I can access using mydomain.com:8081 within the network.
I have, for the sake of testing, cleared all rules in IPTables, so the rules look like this
Chain INPUT (policy ACCEPT 3595K packets, 772M bytes)
pkts bytes target prot opt in out source destination
964K 210M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 6722K packets, 5154M bytes)
pkts bytes target prot opt in out source destination
The config for my domain in Apache2 looks like this
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin [email protected]
DocumentRoot /hdd/web/www/mydomain.com
ErrorLog ${APACHE_LOG_DIR}/mydomain.com-error.log
CustomLog ${APACHE_LOG_DIR}/mydomain.com-access.log combined
</VirtualHost>
The error log or access logs show no trace of me trying to connect to the website, I've checked the general logs and the logs for mydomain.com
I've monitored the netork traffic on my server, and it did detect my requests, so I am reaching the server. I can ping the server fine, but I can't wget it. A tracert shows only one entry, which is my IP address. I've tested this directly from my router, as it has some diagnostic tools than can ping a server, and it can receive packets from a website. It shows the same results, it can ping mydomain.com fine, but can't receive packets from the website.
Please let me know if there is any extra info that can be useful. Thanks