Meteor settings - passenger + nginx

79 views
Skip to first unread message

Ivan Rozhkov

unread,
Apr 5, 2017, 3:44:29 AM4/5/17
to Phusion Passenger Discussions
Hi!
I have meteor running with passenger

server {
   listen 80;
   server_name test.ivan133.ru;

   # Tell Nginx and Passenger where your app's 'public' directory is
   root /var/www/sand/bundle/public;

   # Turn on Passenger
   passenger_enabled on;
   # Tell Passenger that your app is a Meteor app
   passenger_app_type node;
   passenger_startup_file main.js;

   # Tell your app where MongoDB is
   passenger_env_var MONGO_URL mongodb://localhost:27017/test_db;
   # Tell your app what its root URL is
   passenger_env_var ROOT_URL http://test_db.ivan133.ru;
   passenger_meteor_app_settings /tmp2/settings.json;
   passenger_env_var METEOR_SETTINGS '{"fixtures": {"isEnabled": false}}';
}

Now meteor won't start since Meteor.settings.fixtures is undefined.
As you can see about I've tried to use both passenger_meteor_app_settings and METEOR_SETTINGS.

I'm using Meteor 1.4.2.3
And passenger version 5.1.2-1

I'm building my app with 
run meteor build --server-only ../.output
 

Daniel Knoppel

unread,
Apr 5, 2017, 4:24:03 AM4/5/17
to Phusion Passenger Discussions
Keep in mind that Meteor works differently if you bundle the app like you're doing (https://www.phusionpassenger.com/library/indepth/meteor/meteor.html)

As the doc states, passenger_meteor_app_settings doesn't work for bundled apps so you should remove that: https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_meteor_app_settings-filename

So passenger_env_var is what to focus on. Can you try with extra spaces:

passenger_env_var METEOR_SETTINGS ' { "fixtures": { "isEnabled": false } } ';

If that doesn't work perhaps "false" also needs to be quoted?

- Daniel

Ivan Rozhkov

unread,
Apr 5, 2017, 4:53:47 AM4/5/17
to Phusion Passenger Discussions
I've removed passenger_meteor_app_settings.

I've tryed both: 
passenger_env_var METEOR_SETTINGS ' { "fixtures": { "isEnabled": false } } ';

and 
passenger_env_var METEOR_SETTINGS ' { "fixtures": { "isEnabled": "false" } } ';

With no luck (


среда, 5 апреля 2017 г., 11:24:03 UTC+3 пользователь Daniel Knoppel написал:

Daniel Knoppel

unread,
Apr 5, 2017, 6:15:25 PM4/5/17
to Phusion Passenger Discussions
My guess is that there is a problem in your application code. I tried it and for me it works with Passenger 5.1.2 + Nginx + Meteor 1.4.3.2.

Meteor.startup(function () {
  console.log("Meteor startup:");
  console.log(Meteor.settings.fixtures);
}); 

App 28339 stdout: 
App 28339 stdout: Meteor startup:
App 28339 stdout: { isEnabled: false }

- Daniel

Ivan Rozhkov

unread,
Apr 6, 2017, 12:33:13 AM4/6/17
to Phusion Passenger Discussions
I see.
Can you paste you Nginx config here?

четверг, 6 апреля 2017 г., 1:15:25 UTC+3 пользователь Daniel Knoppel написал:

Daniel Knoppel

unread,
Apr 6, 2017, 4:13:05 AM4/6/17
to Phusion Passenger Discussions
Sure, but I used the same as you:

server {
        listen       3000;
        server_name  localhost;

        root /home/test/apps/meteor/.output/bundle/public;

        passenger_startup_file main.js;
        passenger_app_type node;

        passenger_env_var ROOT_URL 'http://localhost:3000';
        passenger_env_var METEOR_SETTINGS '{"fixtures": {"isEnabled": false}}';

        passenger_nodejs /home/test/.nvm/versions/node/v6.2.2/bin/node;
passenger_enabled on;
}

Then I just start Nginx.

- Daniel
Reply all
Reply to author
Forward
0 new messages