apache 2.2 – NGINX IP working but not Subdomain

subdomain.mysite.com is pointed to an IP address, but it does not work when I visit that URL and I am greeted with a “took too long to respond” error.

Here is my conf file for subdomain.mysite.com:

server {
    listen 80;
    listen [::]:80;
    server_name subdomain.mysite.com;
    root /var/www/html;

    index index.html index.htm index.php;

    location / {
        try_files $uri $uri/ =404;

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

    location ~ /.ht {
        deny all;

That’s the only config file that exists under sites-enabled and sites-available but it does not work – only visiting the direct IP address works.

The subdomain is correctly pointed and been updated through DNS.

I also have a wildcard pointed to another IP address – *.mysite.com points to a completely different IP. Maybe that is conflicting with subdomain.mysite.com?

When I run dig subdomain.mysite.com, I get the correct IP address returned.

When I run dig http://subdomain.mysite.com, I get the old, wrong IP address returned.