In a previous post, I discussed how to use Nginx and Apache together on Ubuntu. I have Nginx listening on port 80 and Apache listening on port 8080. I use the Nginx proxy_pass directive to pass all PHP and Django domains (virtual hosts) to Apache. I will continue to use Apache for my existing virtual hosts, but I am going to use PHP-FPM for any new PHP domains that I set up.
I started a new project that will uses MEAN.JS (MongoDB, ExpressJS, AngularJS, Node.js). In my previous post, I discussed setting up Nginx and Apache together on Ubuntu. In this post, I will discuss how to use Express with Nginx. My initial plan was to install Express and use the Express Generator for application scaffolding, but I recently began reading about MEAN.js (and MEAN.io) and decided to use MEAN.js for application scaffolding.
I am beginning a new project that uses MEAN.JS (MongoDB, ExpressJS, AngularJS, Node.js). I use Apache as my webserver on my local Ubuntu VM. When I first read about using Express, I wondered how I would use Express and Apache together. Further confusion came when I learned that my host provider (webfaction uses Nginx to serve static files and Apache for PHP and other server-side technologies. So Node.js and Express will actually be running under Nginx. Because I wanted my development environment to be enulate production as much as possible, I decided to run Nginx and Apache together.