• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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