Configuring Nginx (Ubuntu) - wollardj/Mandrill GitHub Wiki

Previous: Configure pm2

Nginx's installation on Ubuntu is very similar to Apache's. All of its config files are stored in /etc/nginx, and the 'active' sites are symlinked from /etc/nginx/sites-available to /etc/nginx/sites-enabled. The first thing we want to do is remove the sites that are enabled by default since they're just placeholders and don't do anything interesting.

sudo unlink /etc/nginx/sites-enabled/*

Next, we'll create a site config for Mandrill. Be sure to use the same port number you specified when setting up pm2 for the proxy_pass field.


server {
	listen 80 default_server;
	listen [::]:80 default_server ipv6only=on;

	# Change this to your server's FQDN or ip address
	server_name localhost;

	location / {
                # If you configured pm2 to run Mandrill on another port,
                # use that same port here. Leave 'localhost' though.
		proxy_pass http://localhost:3001/;

	location /mandrill {
		proxy_pass http://localhost:3001/;

Lastly, we'll create a symlink to 'enable' the mandrill site.

sudo ln -s /etc/nginx/sites-available/mandrill /etc/nginx/sites-enabled/mandrill

Next: Install Meteor