# Steam认证因配置错误的外部nginx而中断

**URL:** <https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233>\
**Category:** Support\
**Created:** [2022年八月5日 10:52 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233 "2022-08-05T10:52:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kuro22](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuro22/32/261055_2.png) [@Kuro22](https://meta.discourse.org/u/Kuro22)\
**Post date:** [2022年八月5日 10:52 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/1 "2022-08-05T10:52:35Z")

</div>

您好，我已按照说明安装并启用了插件。但是，我在 `/auth/steam` 和 `/auth/steam?reconnect=true` 处遇到了 502 错误。有人能帮我解决这个问题吗？

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年八月5日 10:56 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/2 "2022-08-05T10:56:48Z")

</div>

您需要包含一些带有错误的日志信息。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年八月5日 11:09 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/4 "2022-08-05T11:09:30Z")

</div>

我将  
tail -f /var/discourse/shared/standalone/log/rails/production.log  
并观察您在出现错误时看到的内容

---

<div class="post-metadata">

**Author:** ![Kuro22](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuro22/32/261055_2.png) [@Kuro22](https://meta.discourse.org/u/Kuro22)\
**Post date:** [2022年八月5日 11:15 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/5 "2022-08-05T11:15:11Z")

</div>

点击使用 Steam 登录后，我看到

```plaintext
Started GET "/session/csrf" for (IP address) at 2022-08-05 11:11:54 +0000
Processing by SessionController#csrf as JSON
Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 307)
Started POST "/auth/steam" for (IP address) at 2022-08-05 11:11:55 +0000
(steam) Setup endpoint detected, running now.
(steam) Request phase initiated.

```

然后出现错误页面。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年八月5日 11:17 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/6 "2022-08-05T11:17:30Z")

</div>

这听起来像是 502 错误来自 Steam 而不是 Discourse。浏览器中的网络选项卡是否显示 502 错误来自 Steam 而不是 Discourse？

---

<div class="post-metadata">

**Author:** ![Kuro22](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuro22/32/261055_2.png) [@Kuro22](https://meta.discourse.org/u/Kuro22)\
**Post date:** [2022年八月5日 11:24 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/7 "2022-08-05T11:24:49Z")

</div>

嗯……我看到这个了。

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/0/d/80d905eaa467d6cd8e92e2839f328bfeb71948ad.png)

这是否意味着错误来自 Discourse？顺便说一句，我可以成功访问 Steam 网站。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年八月5日 12:08 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/8 "2022-08-05T12:08:34Z")

</div>

如果该网址是您的论坛，那么是的，它是 discourse，您没有从日志中发送该信息。该 502 应该被记录下来。

---

<div class="post-metadata">

**Author:** ![Kuro22](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuro22/32/261055_2.png) [@Kuro22](https://meta.discourse.org/u/Kuro22)\
**Post date:** [2022年八月5日 12:27 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/9 "2022-08-05T12:27:05Z")

</div>

好的，那是我的论坛。我在 Nginx 的错误日志中发现了以下内容：

```plaintext
2022/08/05 20:23:35 [notice] 1765588#1765588: signal process started
2022/08/05 20:23:56 [error] 1765590#1765590: *121361 upstream sent too big header while reading response header from upstream, client: (IP address), server: www.bfsu.cafe, request: "POST /auth/steam HTTP/2.0", upstream: "http://unix:/var/discourse/shared/standalone/nginx.http.sock:/auth/steam", host: "www.bfsu.cafe", referrer: "https://www.bfsu.cafe/login"

```

看起来我的 Nginx 配置不正确。我可能会在自己搜索后解决这个问题。感谢您到目前为止的帮助！

更新：添加了 `proxy_buffer_size 32k`，问题已解决。 ✅

---

<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:** [2022年九月4日 12:27 UTC](https://meta.discourse.org/t/steam-auth-broken-due-to-misconfigured-external-nginx/235233/10 "2022-09-04T12:27:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
