moving set_env_var function before nginx start function