philippgerbig wrote a reply+100 XP
2mos ago
philippgerbig liked a comment+100 XP
2mos ago
The people at Laravel Forge need to address this, as I've ran into this multiple times when spinning up a Forge server for Laravel/Inertia apps. It seems the default nginx config sets the bar too low for the amount of header data that Laravel sends to the frontend for Inertia - which causes an nginx error and thus the 502.
Here is what I've been adding to the ngnix config (using Forge's editor):
# Increased buffer sizes for Laravel + Inertia
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# FastCGI buffer settings for PHP-FPM
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
And that has stoped the 502's from happening