Skip to content

Instantly share code, notes, and snippets.

@lform-design
Created March 27, 2020 18:25
Show Gist options
  • Select an option

  • Save lform-design/7e9a36bfec1063aca6615e14d603a727 to your computer and use it in GitHub Desktop.

Select an option

Save lform-design/7e9a36bfec1063aca6615e14d603a727 to your computer and use it in GitHub Desktop.

Revisions

  1. lform-design created this gist Mar 27, 2020.
    17 changes: 17 additions & 0 deletions valet-502-errors.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # Fixing 502 Bad Gateway Errors on Valet with Nginx

    This error is usually caused by AJAX calls, and is due to there being too much data in the request for Nginx to process with its current settings.

    1. Create `~/.config/valet/nginx/all.conf` with the following:

    proxy_buffer_size 4096k;
    proxy_buffers 128 4096k;
    proxy_busy_buffers_size 4096k;

    2. Append the following to `/usr/local/etc/nginx/fastcgi_params`

    fastcgi_buffer_size 4096k;
    fastcgi_buffers 128 4096k;
    fastcgi_busy_buffers_size 4096k;

    3. Restart valet as both Nginx and PHP-FPM must be restarted for these settings to take effect.