# 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:** [2016年四月29日 23:04 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:** 2

<div class="post-metadata">

### Author: ![MattCHM](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattchm/32/119926_2.png) [@MattCHM](https://meta.discourse.org/u/MattCHM)
#### Post date: [2016年四月30日 14:57 UTC](https://meta.discourse.org/t/502-bad-gateway-error-after-switching-to-ssl/43477/2 "2016-04-30T14:57:32Z")

</div>

After more researching it look like there is a problem with nginx.https.sock because even if it is present (after rebuilding the app) the error of file not found still shows up.

I have tried deleting the file as per the instructions here:

> [@Nginx.http.sock bind failed after reboot](https://meta.discourse.org/t/nginx-http-sock-bind-failed-after-reboot/29550):
>
> Hello all, I have a discourse forum up and running for 2 months now. I installed it via Docker following the official Instructions. I have it running with nginx to proxy pass requests to discourse. Everything was working fine. Today my hosting company had to reboot my machine. And now I’m getting a 502 Bad Gateway error when trying to access my forum. I found out, that the problem seems to be the following: [emerg] 781#0: bind() to unix:/shared/nginx.http.sock failed (98: Address already i…

However it makes no difference to the log error or the 502 error. If anyone is able to advise I’d be very grateful.

---

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