Default Success Page on DNS Subdomains

Even if i haven’t added the subdomain to hestiacp, it still shows the default page because i added it on my dns, pointing to the server. how do i fix this? i don’t want to add a subdomain for any unhandled open dns routes

  • new hestia user

That’s the default page the web server serves when it doesn’t find a matching virtual host. The content of that page is located in /var/www/html/.

What would you like to happen instead of showing that page?

probably a default thing to block any traffic?

Then edit /etc/nginx/conf.d/a.b.c.d.conf where a.b.c.d is your server’s ip and add return 444; after error_log directive in both server blocks

Something like this:

server {
        listen a.b.c.d:80 default_server;
        server_name _;
        access_log off;
        error_log /dev/null;
        return 444;

        location / {
                proxy_pass http://a.b.c.d:8080;
   }
}

server {
        listen a.b.c.d:443 default_server ssl;
        server_name _;
        access_log off;
        error_log /dev/null;
        return 444;

        ssl_certificate     /usr/local/hestia/ssl/certificate.crt;
        ssl_certificate_key /usr/local/hestia/ssl/certificate.key;

        return 301 http://$host$request_uri;

        location / {
                root /var/www/document_errors/;
        }

        location /error/ {
                alias /var/www/document_errors/;
        }
}

Save the file and reload nginx:

systemctl reload nginx