# 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:** [Juin 3, 2016, 12:59 UTC](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197 "2016-06-03T12:59:55Z")
**Posts on this page:** 3
**Page:** 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: [Juin 3, 2016, 12:59 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):
>
> @pfaffman edited this heavily 2022.02.24. Blame me if it’s broken. 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…

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.

---

<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: [Juin 3, 2016, 4:20 UTC](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197/2 "2016-06-03T16:20:39Z")

</div>

Got it working.

Figured out my issue. Also merged into single cert. Don’t know why I thought I needed two. Also moved off port 85. figured that was not a good one to be using.

My working config

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

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Juin 8, 2024, 12:45 UTC](https://meta.discourse.org/t/bad-gateway-when-trying-to-use-ssl/45197/3 "2024-06-08T12:45:36Z")

</div>

Ce sujet a été automatiquement fermé après 2926 jours. Les nouvelles réponses ne sont plus autorisées.
