# 如何了解 504 错误及其原因？

**URL:** https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483
**Category:** Support
**Created:** [2018年八月11日 15:36 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483 "2018-08-11T15:36:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年八月11日 15:36 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/1 "2018-08-11T15:36:20Z")

</div>

our users report some 504 bad gateway errors for accessing the instance: for example when they like a topic or try to edit their response.

the forum is on a t2-small aws instace, and the swap is 2g.

the memory usage is something like this:

![image](https://global.discourse-cdn.com/meta/original/3X/7/1/7137eea675a4b64d5798c867e1cc180fdc9aae90.png)

1. does the 504 error mean we need to extend our host and add some memory?

2. may the error be due to the cdn (cloudflare)?

3. may it be because of plugins and themes that are installed in our forum?

how can I find out what is the problem and how can I solve it?

thanks in advance for your help ❤

---

<div class="post-metadata">

### Author: ![Genyus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/genyus/32/119655_2.png) [@Genyus](https://meta.discourse.org/u/Genyus)
#### Post date: [2018年八月11日 15:59 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/3 "2018-08-11T15:59:02Z")

</div>

It’s unlikely Cloudflare is the _cause_ of this problem, the error you’re seeing is because it can’t connect to your AWS server upstream:

[https://support.cloudflare.com/hc/en-us/articles/218378978-What-should-I-do-after-seeing-a-502-or-504-gateway-error-on-my-site-](https://support.cloudflare.com/hc/en-us/articles/218378978-What-should-I-do-after-seeing-a-502-or-504-gateway-error-on-my-site-)

Themes don’t have any significant performance impact AFAIK, but plugins can do, depending on which ones you have installed.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年八月11日 16:28 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/4 "2018-08-11T16:28:48Z")

</div>

thanks, the installed plugins seems few to me:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/7/d7483bdfeef1f0edd17c51c057a6756c3a034e4f.png)

from the link, what I got was that we don’t need to extend our host either; as the traffic is not that much to overload the server.

is this error being logged anywhere on the server or cloudflare or discourse admin panel?

also is there anyway to find out what has caused the error? I’m still little bit confused about the reason.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年八月11日 17:08 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/5 "2018-08-11T17:08:30Z")

</div>

another important question:

why some users experience this error and some not? e.g. I’ve rarely faced this problem myself!

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年八月13日 11:24 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/6 "2018-08-13T11:24:04Z")

</div>

we have lots of warnings in the admin log panel:

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/c/0cfeb63b582cdd4d04915f61dda3be5eda59e17b.png)

may this warning be the reason for the 504 error? is it ok to have this much of warnings?

are the 504 errors logged anywhere?

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年八月18日 07:24 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/7 "2018-08-18T07:24:30Z")

</div>

this problem has been solved after we removed the nginx reverse proxy and used the nginx inside docker; steps explained [here](https://meta.discourse.org/t/site-doesnt-launch-after-bringing-back-nginx-reverse-proxy/94636).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2021年三月27日 23:55 UTC](https://meta.discourse.org/t/how-to-find-out-about-504-errors-and-the-reasons/94483/8 "2021-03-27T23:55:13Z")

</div>


