Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

philippgerbig's avatar

philippgerbig wrote a reply+100 XP

2mos ago

Thank you so much! This solved this problem for me!

philippgerbig's avatar

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