How to block DigitalOcean server's ip for public. (To avoid hackers)
Because the website runs only with the domain name, why not stop the public ip of the server like cloudways.com does.
You can see the article of cloudways << here.
The safest way is to use a Cloudflare-like service as a reverse proxy, then only allow the reverse proxy to access the webserver.
You might edit /etc/nginx/sites-enabled/default and serve whatever you want from there (or even a return 403).
Hosted by VirtuBox