Solved — Valet+ / NGINX error: 504 Gateway Time-out

Got a 504 Gateway Time-out during your development using Nginx and Valet+? See here how to solve it.

A few weeks ago I was looking for new alternatives to setup my local development environment when a colleague from work recommended Valet+. I’ve been a Windows user since ever and WAMP has always been enough to fulfill my needs, but since I switched to a MacBook Pro a couple of years ago, I’ve been stuck with low-performance VMs using VirtualBox/Vagrant. I tried XAMPP for OS X but it always stops working after a few days using it.

So far Valet+ is working almost perfectly for me, except for a few issues I find once a while on Nginx, and here is the latest one:

504 Gateway Timeout Error Nginx

This error was displayed when I was placing an order with PrestaShop 1.7.5.0. There was nothing else in the log files.

Solving this issue is easy: just open the file /usr/local/etc/nginx/valet/valet.conf and add the following lines to the block location ~ \.php$ { } :

Now all you have to do is to run on your valet restart terminal and everything should work fine.