---
title: "How does the tenants feature work for sites?"
url: "https://ploi.io/documentation/domains/how-does-the-tenants-feature-work-for-sites"
published: "2021-12-08"
last_updated: "2025-03-05"
---

# How does the tenants feature work for sites?

Consider the tenants feature as domain aliases on steroids. They are almost the same as domain aliases where you have:

```
server_name domain.com anotherdomain.com example.com

```

You will have a full NGINX config per tenant included in the original main domain, that looks like this:

```
include /etc/nginx/ploi/domain.com/tenants/*;


server {
    listen 80;
    listen [::]:80;


    root /home/ploi/domain.com/public;
    server_name anotherdomain.com;


    include /etc/nginx/ssl/anotherdomain.com;


    index index.php index.html;


    charset utf-8;


    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }


    access_log off;
    error_log  /var/log/nginx/anotherdomain.com-error.log error;


    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }


    error_page 404 /index.php;


    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.0-fpm.sock;
        fastcgi_buffers 16 16k;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }


    location ~ /\.(?!well-known).* {
        deny all;
    }
}

```

In the above case, you have the main domain called **domain.com** and the tenant **anotherdomain.com.**

As you can see, the tenant itself is a complete NGINX configuration on its own offering a few extra possibilities:

- Each tenant has the ability to get its own custom NGINX configuration more easily
- Each tenant has its own certificate, and you will not reach the 100 domains per certificate limit in Let's Encrypt
- Each tenant (domain) is shielded in the certificate, as you're not able to see what other tenants are present
- If a certificate expires (because of a DNS change from a tenant for example), other tenants are not affected and will continue to work

How to create a tenant?
-----------------------

Creating tenants is rather easy. When you head over to your site in Ploi, go to the **Manage** tab and press the **Tenants** button.

![](/storage/images/a751e0c8-1a56-40ce-a3a2-ba182a761b02.png)

Then after that, you can start creating tenants (sites) just like you normally do:

![](/storage/images/d6d92f4c-1335-4a9d-bb97-2db07829dde1.png)

The tenants created here, will always point to the same root of the main site, in this case ploi.io.