Nginx 反向代理 Golang HTTP 报错

305 天前
 yaott2020

Nginx 反向代理 Golang HTTP 报错:

http: wrote more than the declared Content-Length

Nginx 配置如下:

    location / {
        proxy_pass          http://127.0.0.1:6003;
        proxy_set_header    Host            $http_host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect      off;
    }

有哪位 v 友遇到过,该如何解决

418 次点击
所在节点    问与答
5 条回复
julyclyde
304 天前
这句错误信息是 nginx“产生”的,还是 nginx 从 golang 那边转发过来的?
yaott2020
303 天前
@julyclyde golang 报错,nginx 给浏览器返回了 404
julyclyde
298 天前
@yaott2020 那应该 500 才对
你别自己理解了,直接发 nginx 的 access 和 error 日志看看吧
yaott2020
298 天前
@julyclyde error 没日志,access 就记了一条 404
julyclyde
298 天前
@yaott2020 设置一下 access 的格式,把 status 和 upstrem status 都记录下来
看看 upstream status 是多少

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/957473

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX