I am using Nginx with Passenger to serve a Rails app. I have hit a strange problem where NginX is not reading the environment variables that the app needs when started normally by the init script. I am using this script: https://github.com/JasonGiedymin/nginx-init-ubuntu/blob/master/nginx When NginX starts via the script the environment variables are not set. If I stop the server, and then restart it manually by doing:
-E /opt/nginx/sbin/nginx
then the environment variables are set. My question is how do I get the init script to do this as well?