I recenly started gettting 504 from Laravel app using valet had some issues while debugging it. Basically it boils down to NGINX. Add these values to your server or http block. proxy_connect_
Here's to do it. Create site at Laravel Forge control panel set web directory to /pub ssh into your server get Magento via composer composer create-project --repository-url=https://repo.magento.com/magento/project-community-edition