Hosting several domains on one machine is normal and efficient. What decides whether it is safe is how separate they are: separate directories, separate database users, and ideally separate system users.

The layout

/var/www/
  site-one/    public/  storage/
  site-two/    public/  storage/
  site-three/  public/  storage/

Each document root points at its own public directory. Nothing above it is reachable from the web, so configuration and storage sit outside where a URL could ever land.

One server block per domain

server {
    listen 443 ssl;
    server_name one.example;
    root /var/www/site-one/public;
    include snippets/php.conf;
}

Keep the databases apart

CREATE DATABASE site_one CHARACTER SET utf8mb4;
CREATE USER 'site_one'@'localhost' IDENTIFIED BY '...';
GRANT ALL PRIVILEGES ON site_one.* TO 'site_one'@'localhost';
One database user with access to every database means a single compromised site reads and writes all of them. This is the most common mistake on a multi-site server and it turns one incident into all of them at once.

Separate PHP pools, if you can

A pool per site, each running as its own user, means one site cannot read another's files even though they share a machine. It also stops one site's traffic exhausting the workers everybody else needs.

; /etc/php/8.3/fpm/pool.d/site-one.conf
[site-one]
user = site-one
group = site-one
listen = /run/php/site-one.sock
pm = ondemand
pm.max_children = 10

Certificates

sudo certbot --nginx -d one.example -d www.one.example
sudo certbot --nginx -d two.example -d www.two.example
Separate certificates rather than one covering everything. Renewal for one domain then cannot take the others down, and the certificate does not publish the list of every site you host.