0

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?

i0n
  • 273
  • 1
  • 3
  • 8

1 Answers1

0

Try adding the variables to the script

export VAR='/blah'

mako_reactor
  • 398
  • 4
  • 11
  • This won't work because the only reference I have for the variable is the variable itself (I don't want to hard code values in an init script), and they are not being passed in. So I would have to do export VAR=$VAR The environment variables are being set in /etc/environment – i0n Feb 26 '13 at 01:00