Score:0

Can't call apache2 web server from local network, but outside works fine

gi flag

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

vidarlo avatar
ar flag
Hairpin NAT is not configured.
Spliid avatar
gi flag
That does seem to be very related to my issue. I'll look into Harpin NAT and update this questions. Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.