当前位置:网站首页>uwsgi-invalid-request-block-size invalid request block size: 21327 (max 4096)... Skip solution

uwsgi-invalid-request-block-size invalid request block size: 21327 (max 4096)... Skip solution

2022-06-22 04:40:00 Humorous Jing Kejun

It took me at least sixorseven hours to answer this question , It must be recorded . The problem is that , I have a seven - Bull joint url, Very, very long , use django Start the service separately , No problem , Pictures can be returned normally . But once used nginx + uwsgi There are problems. .

The first problems you encounter can be seen from the log .

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

I searched the Internet for this question , The answer is .

buffer-size=32768

Let in uwsgi Add... In the configuration file of buffer-size.
Then do it , When you're done, just nginx Report errors .nginx The error reported is like this .

nginx - upstream sent too big header while reading response header from upstream

Then let me nginx Add the following

fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

It doesn't work , And then start trying , Because with django There is no problem starting the service manually , Then test the manual first , then nginx+django Started manually . They all work . Then I started searching uwsgi, Is there a problem with this . But most of the Internet searches are in the above way . Then, the data of that interface is first proxied to django Manually activated services , Start with the service , And then do this uwsgi Of . Later, I checked around , I didn't find uwsgi The problem of , Start searching nginx This error is reported , At least 10 A few questions , I found it in an answer with only one praise .

uwsgi_buffer_size 16k; 
uwsgi_busy_buffers_size 24k; 

as a result of nginx No configuration uwsgi Of buffer, fastcgi This is not right , This should be fastapi For service And then it solved . Think about it , still uwsgi This one is not familiar , I didn't read the document .

Reference resources :

https://stackoverflow.com/questions/57933443/nginx-upstream-sent-too-big-header-while-reading-response-header-from-upstream

https://stackoverflow.com/questions/15878176/uwsgi-invalid-request-block-size/26941287#26941287

https://stackoverflow.com/questions/23844761/upstream-sent-too-big-header-while-reading-response-header-from-upstream

原网站

版权声明
本文为[Humorous Jing Kejun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220435110510.html