I'm tearing my hair out with this, but I've probably missed something obvious. My issue is I can't get environment variables set in /etc/environment working via FPM. This is what I have:
Supervisor configuration
[program:nginx]
command=/usr/sbin/nginx
stdout_logfile=/var/log/supervisor/program_supervise_nginx.log
stderr_logfile=/var/log/supervisor/program_supervise_nginx.error
priority=100
user=root
autostart=true
autorestart=true
EnvironmentFile=/etc/environment
[program:fpm]
command=/usr/sbin/php-fpm7.2 --nodaemonize -c /etc/php/7.2/fpm/php-fpm.conf
user=root
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true
EnvironmentFile=/etc/environment
FPM pool configuration
[domain]
...
clear_env = no
...
php.ini (/etc/php/7.2/fpm/php.ini)
...
variables_order = "EGPCS"
...
I can set environment variables directly in the pool configuration and this works via FPM, e.g. if I have this configuration in my fpm pool -
[domain]
...
clear_env = no
env[FOO] = bar
...
- then I can access "FOO" using getenv["FOO"] via FPM.
The problem I simply can't load in /etc/environment.
I've seen other posts mentioning having to explicitly include my environment variables as fast_cgi params in nginx, however, given that my supervisor config for FPM is explicitly setting the environment, I was hoping to avoid this step (and of course - avoid the duplication of setting vars in two places)
Any ideas anyone!? Any assistance much appreciated.