简体   繁体   English

Laravel Valet/Nginx: 502 Bad Gateway: 93883#0: *613 上游发送过大

[英]Laravel Valet/Nginx: 502 Bad Gateway: 93883#0: *613 upstream sent too big header while reading response header from upstream, client: 127.0.0.1

I've tried increasing the buffer sizes as suggested in other threads.我已经尝试按照其他线程中的建议增加缓冲区大小。 Here is the output of这是output

sudo nginx -T | grep buffer
fastcgi_buffer_size 4096k;
fastcgi_buffers 128 4096k;
fastcgi_busy_buffers_size 4096k;
proxy_buffer_size   4096k;
proxy_buffers   128 4096k;
proxy_busy_buffers_size   4096k;

I've restarted valet but I am still getting the error when submitting a POST request after adding something to my cart using darryldecode/laravelshoppingcart.我已经重新启动代客泊车服务,但在使用 darryldecode/laravelshoppingcart 向我的购物车添加内容后提交 POST 请求时仍然出现错误。

Any suggestions?有什么建议么?

Thanks in advance!提前致谢!

I was getting this same error from my local Drupal 9 site.我从本地 Drupal 9 站点收到了同样的错误。 I've spent a few hours myself trying to find a solution that actually works for Valet (plus).我自己花了几个小时试图找到一个真正适用于 Valet (plus) 的解决方案。 After some trial and error the following steps solved the problem for me.经过反复试验,以下步骤为我解决了问题。 Hope this helps anyone facing the same issue:希望这可以帮助任何面临同样问题的人:

  1. go to the nginx config folder: go 到 nginx 配置文件夹:

     cd /usr/local/etc/nginx
  2. edit the nginx.conf file:编辑 nginx.conf 文件:

     sudo nano nginx.conf
  3. add these lines to the http{} section and save the file:将这些行添加到 http{} 部分并保存文件:
    proxy_buffer_size 4096k; proxy_buffer_size 4096k;
    proxy_buffers 128 4096k; proxy_buffers 128 4096k;
    proxy_busy_buffers_size 4096k; proxy_busy_buffers_size 4096k;

     http { include mime.types; default_type application/octet-stream; proxy_buffer_size 4096k; proxy_buffers 128 4096k; proxy_busy_buffers_size 4096k; sendfile on; tcp_nopush on; tcp_nodelay on; ...
  4. edit the fastcgi_params file:编辑 fastcgi_params 文件:

     sudo nano fastcgi_params
  5. append these lines to the end of the file: append 这些行到文件末尾:
    fastcgi_buffer_size 4096k; fastcgi_buffer_size 4096k;
    fastcgi_buffers 128 4096k; fastcgi_buffers 128 4096k;
    fastcgi_busy_buffers_size 4096k; fastcgi_busy_buffers_size 4096k;

     fastcgi_param HTTPS $https if_not_empty; fastcgi_param REDIRECT_STATUS 200; fastcgi_param HTTP_PROXY ""; fastcgi_buffer_size 4096k; fastcgi_buffers 128 4096k; fastcgi_busy_buffers_size 4096k;
  6. restart valet:重启代客:

     valet restart
  7. Refresh the site in your browser在浏览器中刷新网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM