Deploy app nginx+ passenger

Hello there:

I’m trying to put a meteor app into production. I have followed this tutorial:

https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/ownserver/nginx/enterprise/bionic/deploy_app.html#login-as-the-app-s-user

I use nginx + passenger, and all I get is this message “We’re sorry, but something went wrong.” of passenger.

The steps have been:
1.- Install mongoDB
2.- meteor build
3.- deploy meteor app and install dependencies
4.- Set nginx configuration
5.- Restart nginx

server {
        listen IP:80;
        listen IP:443 ssl http2;

        ssl_protocols TLSv1.3 TLSv1.2;
        ssl_certificate /var/www/clients/client5/web10/ssl/testing.com-le.crt;
        ssl_certificate_key /var/www/clients/client5/web10/ssl/testing.com-le.key;

        server_name testing.com www.testing.com;

        root   /var/www/testing.com/web/bundle/public;

        error_log /var/log/ispconfig/httpd/testing.com/error.log;
        access_log /var/log/ispconfig/httpd/testing.com/access.log combined;

        # 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;
        # Tell your app what its root URL is
        passenger_env_var ROOT_URL http://testing.com;
}

Note: I had to create the public folder (empty) since it was not generated in the build. I don’t know if this is correct.

I am desperate to get my app working, I appreciate any help. If there is a better way to start the app, please let me know.

Thank you

1 Like

I did it works, the problem was the connection with mongoDB.

Added user and pass in the MONGO_URL and it worked.

I hope this helps someone.

1 Like

Hi perhaps you can help me here …i’m having trouble deploying my meteor app. How did you go about it with the MONGO URL?

It’s because of the environmental variables - you must do export MONGO_URL="mongodb://127.0.0.1:27017/Meteor" and also export ROOT_URL="http://mydomain.com" in the shell you start Meteor in or it wont have these settings loaded, to view all of the env vars just type export in shell and it will show you what is already set