Valet is awesome, but I got seemingly random 502 bad gateway issues on larger sites. After looking in the logs (~/.config/valet/Log) I discovered the error was upstream sent too big header
. Googling led me to laravel/valet#290 where the following solution fixed it:
- Create
~/.config/valet/Nginx/all.conf
with this:
proxy_buffer_size 4096k;
proxy_buffers 128 4096k;
proxy_busy_buffers_size 4096k;
- Append this to
/usr/local/etc/nginx/fastcgi_params