From b097f871807cb748ecbd29fc3767f52fc5f5f454 Mon Sep 17 00:00:00 2001 From: Matt Kingshott <51963402+mattkingshott@users.noreply.github.com> Date: Thu, 29 Jul 2021 16:47:24 +0100 Subject: [PATCH] Prevent 502 errors when using AJAX When using the Laravel DebugBar with the `capture_ajax` flag set to `true`, its AJAX request monitoring exceeds the FastCGI buffer limit. This results in Nginx throwing a 502 Bad Gateway exception. This PR increases the size of the buffer. While it is not guaranteed to fix the problem, the increased buffer size should solve the issue for most developers. Further discussion on this subject can be [found in this issue on the DebugBar repo](https://github.com/barryvdh/laravel-debugbar/issues/251) --- cli/stubs/valet.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/stubs/valet.conf b/cli/stubs/valet.conf index e0d3d7a..a83ae4a 100644 --- a/cli/stubs/valet.conf +++ b/cli/stubs/valet.conf @@ -27,6 +27,10 @@ server { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass "unix:VALET_HOME_PATH/valet.sock"; fastcgi_index "VALET_SERVER_PATH"; + fastcgi_temp_file_write_size 10m; + fastcgi_busy_buffers_size 512k; + fastcgi_buffer_size 512k; + fastcgi_buffers 16 512k; include fastcgi_params; fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH"; fastcgi_param PATH_INFO $fastcgi_path_info;