# 502 Bad gateway error after switching to SSL

**URL:** https://meta.discourse.org/t/502-bad-gateway-error-after-switching-to-ssl/43477
**Category:** Self-hosting
**Created:** [29.Апрель.2016 23:04:26 UTC](https://meta.discourse.org/t/502-bad-gateway-error-after-switching-to-ssl/43477 "2016-04-29T23:04:26Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![glynhudson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/glynhudson/32/120597_2.png) [@glynhudson](https://meta.discourse.org/u/glynhudson)
#### Post date: [01.Май.2016 22:30:07 UTC](https://meta.discourse.org/t/502-bad-gateway-error-after-switching-to-ssl/43477/6 "2016-05-01T22:30:07Z")

</div>

I am also running other websites on my server. As described in this post I am running Discouse in a Docker container with Nginx running on my server. Nginx proxy all traffic to the Discourse docker via a web socket. I have then setup other virtual hosts in Nginx for my others sizes, which then inturn proxy to Apache:

> [@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…

---

_[View the full topic](https://meta.discourse.org/t/502-bad-gateway-error-after-switching-to-ssl/43477)._
