recv() failed (104: Connection reset by peer) while reading response header from upstream

NGIN + UWSGI,get请求头过大,报502 Bad Gateway

如下,较大的get请求:

http://192.168.1.200:10000/planner/query?getdata=1&query=%7B%22activeDayspan%22%3A%227%22%2C%22condition%22%3A%22%22%2C%22hitLimits%22%3A%22%22%2C%22groupby%22%3A%5B%5B%22wrappedInterests%22%2C400%2C%5B%5D%5D%2C%5B%22demographicGender%22%2C20%2C%5B%5D%5D%2C%5B%22demographicIncome%22%2C20%2C%5B%5D%5D%2C%5B%22demographicEducation%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsClick%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspAdsImpression%22%2C10%2C%5B%5D%5D%2C%5B%22dspAdsClick%22%2C10%2C%5B%5D%5D%2C%5B%22viewthrough%22%2C20%2C%5B%5D%5D%2C%5B%22interests%22%2C10%2C%5B%5D%5D%2C%5B%22pid%22%2C20%2C%5B%5D%5D%2C%5B%22keyword%22%2C20%2C%5B%5D%5D%2C%5B%22companyVisited%22%2C10%2C%5B%5D%5D%2C%5B%22companyADViewed%22%2C20%2C%5B%5D%5D%2C%5B%22remarketing%22%2C20%2C%5B%5D%5D%2C%5B%22country%22%2C20%2C%5B%5D%5D%2C%5B%22province%22%2C50%2C%5B%5D%5D%2C%5B%22city%22%2C20%2C%5B%5D%5D%5D%7D&_=0.2326625478453934


NGINX中的error.log日志记录,表现为,类似:

recv() failed (104: Connection reset by peer) while reading response header from upstream


解决办法,在uwsgi中添加参数:

/usr/local/sbin/uwsgi -s 127.0.0.1:1182 -M -R 200 -p 4 --virtualenv="/usr/local/python-env/test-env" --env "DJANGO_SETTINGS_MODULE=settings" -w "django.core.handlers.wsgi:WSGIHandler()" --post-buffering32768 --buffer-size 32768


uwsgi 详细配置见:http://uwsgi-docs.readthedocs.org/en/latest/Options.html

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值