I’m trying to deploy our Meteor app (web), and after reading many tutorials, it seems that everybody installs a webserver such as Nginx and use it as a proxy to the app.
In my case, we are having a dedicated server that this meteor app would be the only app/webpage running on the server, why shouldn’t run it directly on port 80, and that be the end of it? What are the benefits of running the Nginx when the only website running is the meteor app?
PS- I have thought of SSL enabled scenarios, do we have to run a webserver such as Nginx in case we wanted to support SSL?
Based on what I know, there are two main reasons not to host directly from Node/Meteor:
Node needs to run as root to bind port 80, which is bad for a bunch of reasons.
(caveat: there are ways around binding port 80 without root which might be useful here)
Node is a lot slower at terminating and interpreting SSL connections than nginx and other dedicated web servers/proxies/ssl terminators.
Nginx can also give you the benefit of caching static assets and serving them very efficiently.
That said, you can definitely run Meteor as the webserver, and it will still perform very well. Just get it to start on port 80 and you’re good to go.
Here’s what my conf looks like for SSL termination and proxying to Meteor on port 3000
I also use a second conf for port 80 that just redirects rather than having it in here
We are using this repo for production-grade deployment on servers using NGinx and load-balancing.
If your app is in production and has users you’ll have to invest to do things right (I would recommend Galaxy if you are making money off your app already, Very High Availability is not an easy task)