# Periodic 502 Bad Gateway

**URL:** <https://forum.ghost.org/t/periodic-502-bad-gateway/20620>\
**Category:** Developer help\
**Created:** [March 8, 2021, 4:32pm UTC](https://forum.ghost.org/t/periodic-502-bad-gateway/20620 "2021-03-08T16:32:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adtechexplained](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@adtechexplained](https://forum.ghost.org/u/adtechexplained)\
**Post date:** [March 8, 2021, 4:32pm UTC](https://forum.ghost.org/t/periodic-502-bad-gateway/20620/1 "2021-03-08T16:32:23Z")

</div>

I am seeing a periodic 502 bad gateway error when loading my site:

> **[Ad Tech Explained](https://adtechexplained.com)**
>
> Ad Tech Explained provides explainers, insights, and analysis on the latest trends in advertising technology. Subscribe to stay ahead of the curve in ad tech.

Sometimes it loads and sometimes I receive a 502 Bad gateway error. So my site is working on and off.

I’m running the latest version of Ghost (3.42.0) on Digital Ocean.

The only thing I changed recently was to add a https www URL so that [https://www.adtechexplained.com](https://www.adtechexplained.com) resolves and redirects to [https://adtechexplained.com](https://adtechexplained.com). I followed the directions under “SSL for additional domains” here:

> **[Ghost-CLI - A fully loaded tool for installation and configuration](https://ghost.org/docs/ghost-cli/#knowledgebase)**
>
> The best way to install, manage, and update your site locally or when self-hosting Ghost. A full guide for our advanced CLI tool.

I also added a new A record for “www” to point to my DO instance. I since removed that in case that was causing issues.

Is there any reason why sometimes the site loads successfully and sometimes it shows a 502 bad gateway error?

---

<div class="post-metadata">

**Author:** ![Torqu3Wr3nch](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/torqu3wr3nch/32/11937_2.png) [@Torqu3Wr3nch](https://forum.ghost.org/u/Torqu3Wr3nch)\
**Post date:** [March 8, 2021, 6:15pm UTC](https://forum.ghost.org/t/periodic-502-bad-gateway/20620/2 "2021-03-08T18:15:28Z")

</div>

Do you have anything in the Ghost error or access logs?

When you get the 502 error, do you see the request in the Ghost access logs? (I think technically there are two places where you should be able to see access attempts: one from Ghost itself in /var/www/ghost/content/logs/ and another in NGINX).
