加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

NGINX uWSGI连接由Peer重置

发布时间:2020-12-13 21:02:57 所属栏目:Nginx 来源:网络整理
导读:我正在尝试使用uWSGI在NGINX上托管Bottle Application. 这是我的nginx.conf location /myapp/ { include uwsgi_params; uwsgi_param X-Real-IP $remote_addr; uwsgi_param Host $http_host; uwsgi_param UWSGI_SCRIPT myapp; uwsgi_pass 127.0.0.1:8080; }

我正在尝试使用uWSGI在NGINX上托管Bottle Application.

这是我的nginx.conf

location /myapp/ {
        include uwsgi_params;
        uwsgi_param X-Real-IP $remote_addr;
        uwsgi_param Host $http_host;
        uwsgi_param UWSGI_SCRIPT myapp;
        uwsgi_pass 127.0.0.1:8080;
    }

我正在运行uwsgi

uwsgi --enable-threads --socket :8080 --plugin python -- wsgi-file ./myApp/myapp.py

我正在使用POST请求.对于使用dev Http Client的那个.当我发送请求时,这是无限的

http://localhost/myapp

uWSGI服务器接收请求并打印

[pid: 4683|app: 0|req: 1/1] 127.0.0.1 () {50 vars in 806 bytes} [Thu Oct 25 12:29:36 2012] POST /myapp => generated 737 bytes in 11 msecs (HTTP/1.1 404) 2 headers in 87 bytes (1 switches on core 0)

但在nginx错误日志中

2012/10/25 12:20:16 [error] 4364#0: *11 readv() failed (104: Connection reset by peer) while reading upstream,client: 127.0.0.1,server: localhost,request: "POST /myApp/myapp/ HTTP/1.1",upstream: "uwsgi://127.0.0.1:8080",host: "localhost"

该怎么办?

最佳答案
如果不在应用程序中读取数据,则无法从客户端发布数据.虽然这在uWSGI中不是问题,但nginx会失败.您可以使用uWSGI的–post-buffering选项“伪造”该东西,以自动从套接字读取数据(如果可用),但您最好“修复”(即使我不认为这是一个错误)应用

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读