# Bad gateway when trying to use SSL

**URL:** <https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197>\
**Category:** Self-hosting\
**Created:** [03.Июнь.2016 12:59:55 UTC](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197 "2016-06-03T12:59:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)\
**Post date:** [03.Июнь.2016 12:59:55 UTC](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197/1 "2016-06-03T12:59:55Z")

</div>

## Problem:

I have a DO server setup with a Wordpress site and Discourse. I have rencently made the move to SSL.

I went through and followed the guide here:

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247):
>
> If you want to run other websites on the same machine as Discourse, you need to set up an extra NGINX or HAProxy proxy in front of the Docker container. NOTE: This is for advanced admins This guide assumes you already have Discourse working - if you don’t, it may be hard to tell whether or not the configuration is working. You cannot use ./discourse-setup to set up Discourse if another server is using port 80 or 443. You will need to copy and edit samples/standalone.yml with your favorite tex…

And the DO guide here

> **[How To Install Discourse Behind Nginx on Ubuntu 14.04 | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-install-discourse-behind-nginx-on-ubuntu-14-04)**
>
> Discourse is an open source community discussion platform built for the modern web. This tutorial will walk you through the steps of configuring Discours…

Either guide is giving me a bad gateway error when I try to go to SSL for the Discourse site.

## My Setup:

Curently running NGINX 1.10.0 which is hosting my wordpress site ([grimreapergamers.com](http://grimreapergamers.com)) and proxy to my Discourse site ([forums.grimreapergamers.com](http://forums.grimreapergamers.com)). I created two seperate certs through Let’s Encrypt. One for [grimreapergamers.com](http://grimreapergamers.com) and one for [forums.grimreapergamers.com](http://forums.grimreapergamers.com). My wordpress site is up and running with the cert today. When I try to change the NGINX config for the discourse site to use the cert I get a bad gateway error. Discourse is listening on port 85.

Here is my NGINX config for the discourse site. The commented out sever block is what is live today and working. The two blocks below are what I am trying to go to. Appreciate any guidance thanks.

> <https://pastebin.com/JJUYGNFM>

I should point out that I have the http2 module loaded in NGINX which is why I am using that instead of SPDY.

---

_[View the full topic](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197)._
