tenant_id
column (not separate tables).Shared folder with subfolders per tenant:
storage/uploads/{TENANT_ID}/...
Database stores only the relative path:
uploads/{TENANT_ID}/file.jpg
Nginx:
client_max_body_size 50M;
Cookies are already isolated per domain.
If using Redis or file cache: prefix keys with:
tenant:{TENANT_ID}:
server {
listen 80;
server_name example1.com www.example1.com example2.com www.example2.com;
root /var/www/app/public;
index index.php;
location / {
try_files $uri /index.php?$query_string;
}
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
client_max_body_size 50M;
}
π SSL Options:
certbot
for each domain.