FPM configration stats that you can retrieve variables from your current environment. However, on ubuntu using Nginx and PHP-FPM, I can not find a way to retrieve the variable value from the environment without hard coding it in the php-fpm.conf or nginx fcgi params.
Is there a way to get the environment variable from /etc/environment or /etc/bash.bashrc?
For ex:
clear_env = no
ENV[SECRET_TOKEN] = $SECRET_TOKEN
I think the main problem is not being able to modify the env vars for www-data. As >sudo -H -u www-data bash -c "env"
does not include SECRET_TOKEN
.