Set up SSL with Nginx on Ubuntu Server 14.04


I need to add SSL support to an app that I deployed on an Ubuntu 14.04 server. The app was working fine with Nginx until I tried adding SSL… Now the web page just shows a 502 bad gateway page and I’ve spent 3 hours trying to figure out what is happening. The app is here if you’d like to take a look. I used mup to deploy and added the ssl support inside the /etc/nginx/sites-enabled/citreuse_com/ file. I also tried using an ssl.pem file in mup per the mup instructions and that did not work either. Does anyone have experience adding SSL to an Ubuntu server? If so, I could use some help…


After adding the ssl.pem file do you ran:

mup reconfig


No, I didn’t. I actually just figured it out! I removed Nginx from the server and only did the ssl option inside the mup file. It all works now!


Hey Ryanswapp!

I’m trying to do same as you. Meteor Up, Ubuntu 14.04 server + nginx and SSL protocol. How did you make it work for you? Your last answer is not pretty clear.

Thanks a lot!


@garbolino I ended up not needing nginx, so what I did was completely remove nginx from the server. I never was able to get ssl working with nginx, but I didn’t try for more than a couple hours so I’m not sure how hard it is. After removing nginx, I used a pem file with mup (per the instructions) and everything worked perfectly. If you need to get nginx working I don’t have much to offer… I haven’t yet had to do it.


I’m sorry you couldn’t get nginx to work. As I myself love to do admin work on servers and most of my developer friends hate these tasks I have included an optimized and working sample for an nginx configuration on GitHub:

If you should ever need nginx I suggest you take a look at it. It will get you good grades at SSL Testers as well :smile:


@ryanswapp this may come handy! I have used this guide extensively in my SSL setup and it worked like a charm:


+1 for this guide. Used it successful yesterday. The only problem with that guide is that he refers you to instruction on creating a self-signed SSL cert, which is useless for a production app. Used this other DO guide to great effect for the commercial SSL cert:


Well, as far as I remember it has been written for the case when you already have server key and pem. The author pointed out, should you be lacking the commercial certificate, you can self-sign the server, just to get things running. This is how I started :smile:


I am configuring SSL with MUP, and it is really easy but thing is when I check my site in SSL Testers, the result is F i.e fail. Have you tested your site? And when I am trying to configure nginx the properties are not at all reflecting.