Saturday, October 1, 2016

Set environment variables for rails app hosted in nginx/passenger




How do I set environment variables so that they are available to my rails app hosted inside nginx/passenger?


Answer



I tried a few different nginx including passenger_set_cgi_param, env and fast_cgi_param. Unfortunately none of these worked for me. In the end I exported them as bash variables in the startup script I was using to launch nginx.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...