0

I've tried increasing the buffer sizes as suggested in other threads. Here is the output of

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.

Any suggestions?

Thanks in advance!

user7431590
  • 91
  • 1
  • 7
  • Still having this problem. Can anyone help? – user7431590 Jan 13 '21 at 10:37
  • Did you ever figure out what the issue was? I’m having the same issue, albeit with [a different LaravelShoppingCart library](https://github.com/bumbummen99/LaravelShoppingcart/). I get the same “upstream sent too big header” error if I try to return a view or redirect after doing anything cart-related beyond listing the contents, like adding an item or restoring the cart from the database. – Janus Bahs Jacquet Apr 22 '22 at 14:51

1 Answers1

4

I was getting this same error from my local Drupal 9 site. I've spent a few hours myself trying to find a solution that actually works for 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:

    cd /usr/local/etc/nginx
    
  2. edit the nginx.conf file:

    sudo nano nginx.conf
    
  3. add these lines to the http{} section and save the file:
    proxy_buffer_size 4096k;
    proxy_buffers 128 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:

    sudo nano fastcgi_params
    
  5. append these lines to the end of the file:
    fastcgi_buffer_size 4096k;
    fastcgi_buffers 128 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