• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Custom nginx configuration for a Meteor app

James Newton

New Pleskian
Hello Plesk pundits!

I am setting up a server managed by Plesk Onyx 17.0.17 Update #35 to deliver a Meteor app. The non-Plesk way of doing this would be to set up an nginx config file with content like this:

server {
listen 80;
server_name meteor.myserver.com;

# Tell Nginx and Passenger where the Meteor app's 'public'
# directory is
root /var/www/vhosts/myserver.com/meteor.myserver.com/bundle/public;

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

# Tell the app where MongoDB is
passenger_env_var MONGO_URL mongodb://localhost:27017/myappdb;
# Tell the app what its root URL is
passenger_env_var ROOT_URL http://meteor.myserver.com;
}


I have found this answer to a similar question, but it dates from 2013, and is immediately followed by the comment:

> note that this solution will break apart during upgrade to Plesk 11.5
> (where this functionality is present out of the box).

I am guessing that the "out of the box" solution is found in the Plesk Onyx 17's interface at Websites & Domains > meteor.myserver.com > Apache & nginx settings, but if so, I am not sure exactly how to insert this particular configuration.

What is the most Plesk-17-friendly way of configuring nginx the way I want it?

Thanks in advance for any enlightenment,

James
 
I would do it outside of Plesk and place a file with that content in

/etc/nginx/conf.d/zz090_meteor.myserver.com.conf

By preceding the filename with zz090_ you will make sure it will be processed after /etc/nginx/conf.d/zz010_psa_nginx.conf

If you also want to create an entry in Plesk of that domain and have all the benefits like the control panel, DNS configuration and so on.
You can do that too....
But then you have to make sure your custom config takes precedence over the Plesk configuration.
This is done by naming it

/etc/nginx/conf.d/ww010_meteor.myserver.com.conf

In that case the Plesk Nginx config will NOT be executed for that domain....
 
Back
Top