Petros Kyriakou
Petros Kyriakou

Reputation: 5343

Nginx + Phusion Passenger + Rails = staging ENV won't be set

I am having trouble making phusion passenger see that the server is set for staging instead of production.

I have changed /etc/nginx/sites-enabled/<my app>

using sudo nano /etc/nginx/sites-enabled/<my app>

server {
    listen 80;
    server_name <app name>;
    return 301 https://$host$request_uri;
}
server {
  listen 443 ssl;
  server_name <app name>;

  passenger_enabled on;
  passenger_app_env staging;
  rails_env staging;
  root /home/deploy/apps/<app name>/current/public;

  location ~ /.well-known {
    allow all;
  }
}

basically added/changed lines

passenger_app_env staging; rails_env staging;

but still not working, is there anything else i need to do?

Upvotes: 2

Views: 669

Answers (1)

Petros Kyriakou
Petros Kyriakou

Reputation: 5343

For future reference after two hours of searching i found out that

rails_env "staging"; line of code

should be added to /etc/nginx/nginx.conf instead.

Hope that helps someone.

Upvotes: 3

Related Questions