uwsgi invalid request block size

匿名 (未验证) 提交于 2019-12-03 01:58:03

问题:

I'm running uwsgi in emperor mode

uwsgi --emperor /path/to/vassals/ --buffer-size=32768 

and getting this error

invalid request block size: 21327 (max 4096)...skip 

What to do?? I also tried -b 32768

回答1:

I aslo ran into same issue while following some tutorial. The problem was that I set the option socket = 0.0.0.0:8000 instead of http = 0.0.0.0:8000. socket option intended to be used with some third-party router (nginx for instance), while when http option is set uwsgi can accept incoming HTTP requests and route them by itself.



回答2:

The correct solution is not to switch to HTTP protocol. You just need to increase the buffer size in uWSGI settings.

buffer-size=32768 

or in commandline mode:

-b 32768 


回答3:

I ran into the same issue trying to run it under nginx and was following the docs here. It is important to note that once you switch to nginx you have to make sure you are not trying to access the app on the port specified by the --socket param but rather the "listen" port in nginx.conf. Although your problem is described differently the title matches exactly the issue I had.



回答4:

I could fix it adding --protocol=http to the uwsgi



回答5:

This error is shown when uWSGI server is using uwsgi protocol and one tries to access it via http protocol by curl or web browser directly. If you can, try configuring your uWSGI server to use http protocol, so you can access it via web browser or curl.

In case you cannot (or do not want to) change it, you can use a reverse proxy (e.g. nginx) in front of local or remote uWSGI server, see http://uwsgi-docs.readthedocs.org/en/latest/Nginx.html

If it feels like too much work, give a try to uwsgi-tools python package:

$ pip install uwsgi-tools  $ uwsgi_curl 10.0.0.1:3030 

There is also a simple reverse proxy server uwsgi_proxy if you need to access your application(s) via web browser etc. See more expanded answer https://stackoverflow.com/a/32893520/179581



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!