feat: Infrastructure multi-tenant avec isolation par sous-domaine
Une application SaaS éducative nécessite une séparation stricte des données entre établissements scolaires. L'architecture multi-tenant par sous-domaine (ecole-alpha.classeo.local) permet cette isolation tout en utilisant une base de code unique. Le choix d'une résolution basée sur les sous-domaines plutôt que sur des headers ou tokens facilite le routage au niveau infrastructure (reverse proxy) et offre une UX plus naturelle où chaque école accède à "son" URL dédiée.
This commit is contained in:
13
backend/.env
13
backend/.env
@@ -17,7 +17,7 @@
|
||||
APP_ENV=dev
|
||||
APP_SECRET=change_me_in_production_12345678
|
||||
TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
||||
TRUSTED_HOSTS='^(localhost|php|127\.0\.0\.1)$'
|
||||
TRUSTED_HOSTS=^(localhost|php|127\.0\.0\.1|(.+\.)?classeo\.local)$
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
@@ -52,3 +52,14 @@ MEILISEARCH_API_KEY=masterKey
|
||||
###> symfony/mailer ###
|
||||
MAILER_DSN=smtp://mailpit:1025
|
||||
###< symfony/mailer ###
|
||||
|
||||
###> symfony/routing ###
|
||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||
DEFAULT_URI=http://localhost
|
||||
###< symfony/routing ###
|
||||
|
||||
###> multi-tenant ###
|
||||
# Base domain for tenant resolution (e.g., classeo.fr, classeo.local)
|
||||
TENANT_BASE_DOMAIN=classeo.local
|
||||
###< multi-tenant ###
|
||||
|
||||
Reference in New Issue
Block a user