That is partially true. However, when WP_ENV
is invoked via php (e.g. wp-config), The envelope varible still has to initiated by the server ( Apache e.g. server-environment-prod.conf example: SetEnv ENVIRONMENT "production"
). To set it in NGINX: it would be: SetEnv ENVIRONMENT "production"
Since ee
has a set up the I am having trouble following and to my lack of NGINX knowledge, I am not sure to what file and blocks to put them. Usually in a more basic .conf, everything is in one place and I have no issue in adding the SetENV
.
My usage is as follows in my wp-config.env.php
file:
<?php
switch ($hostname) {
case 'dev.somesite.com':
define('WP_ENV', 'development');
break;
case 'staging.somesite.com':
define('WP_ENV', 'staging');
break;
case 'somesite.com':
default:
define('WP_ENV', 'production');
}
I may have to try creating a .conf-env file and link it to the site .conf but I am concerned what ee update my do to it.