From 1702087b58fdab9fb817791e452b681216e6b771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= Date: Mon, 22 May 2023 18:44:01 +0200 Subject: [PATCH] Doc for multi tenancy --- docs/general-parameters.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/general-parameters.rst b/docs/general-parameters.rst index f2f6fce..e65f5cb 100644 --- a/docs/general-parameters.rst +++ b/docs/general-parameters.rst @@ -19,6 +19,40 @@ White Pages default configuration file is ``white-pages/conf/config.inc.php``. I Do not copy ``config.inc.php`` into ``config.inc.local.php``, as the first one includes the second. You would then create an infinite loop and crash your application. +Multi tenancy +------------- + +You can load a specific configuration file by passing a HTTP header. +This feature is disabled by default. To enable it: + +.. code-block:: php + + $header_name_extra_config = "WP-Extra-Config"; + +Then if you send the header ``WP-Extra-Config: domain1``, the file +``conf/config.inc.domain1.php`` will be loaded. + +Using Apache, we may set such header using the following: + +.. code-block:: apache + + + ServerName wp.domain1.com + RequestHeader setIfEmpty WP-Extra-Config domain1 + [...] + + +Using Nginx, we could use instead: + +.. code-block:: nginx + + server { + [...] + location ~ \.php { + fastcgi_param WP-Extra-Config domain1; + [...] + } + Language --------