Laravel 11 + Vue.js Issues with Path Rewriting, API Endpoint, and 504 Gateway | Time-out using richarvey/nginx-php-fpm Docker Image

Hi everyone,

I’m having some issues with my application, and I hope someone can help. Below are the details of my setup and the problems I’m facing:

Background

  • I’m using the richarvey/nginx-php-fpm Docker image.
  • Locally, everything works fine when I use a standard image and manually configure PHP-FPM and NGINX.
  • The app is built with Laravel + Vue.js (Vite).
  • Sometimes npm run process gets killed unexpectedly:
    LOG:
    /var/www/html/scripts/00-laravel-deploy.sh: line 17: 289 Killed npm run render
    I don’t know why this happens.

Issues

  1. Path Rewriting Not Working
  1. Weather API Endpoint Issue
  1. 504 Gateway Time-out
  • Occasionally, I also run into a 504 Gateway Time-out error.
  • This is quite frustrating, and it’s making me hesitant to upgrade to the $7 plan given the instability I’m experiencing.

Configuration Details

  • The NGINX configuration is the same as provided in the example for the Docker image.

Question

Can anyone help me understand why the path rewriting might not be working and why I’m seeing the NGINX error page instead of the Laravel one? Any suggestions on how to address the 504 errors would also be greatly appreciated.

Thank you in advance for your help!

Hi there,

Generally speaking, 404 errors are application issues and not anything caused by Render. I recommend reaching out to a community that specializes in your tech stack (or Stack Overflow) for assistance here.

Regarding the 504 error, we don’t often see these. Feel free to reach out to us privately via the Contact Support link in the Dashboard so we can take a closer look at the service. Be sure to specify which service (name or id) this is.

Finally, we have a guide for PHP/Laravel deployments that may be helpful to compare your setup against: https://docs.render.com/deploy-php-laravel-docker

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

So, I had this exact same problem after following the Laravel App Deployment Guide using Docker that Render shared to a T.

Turns out my problem was quite trivial but kinda difficult to spot without much nginx experience:

I had misplaced the nginx-site.conf file. I had placed the file in the conf/nginx-site.conf directory at the base of my local Laravel project, instead of having it under the conf/nginx/nginx-site.conf directory, which is the correct place for it to be in order to the nginx configuration to be picked up by the deployed app instance.

And that alone made nginx not be properly configured to route all requests beyond the homepage to the index.php file in the Laravel App that itself registered all the routes.

Thanks for sharing that solution, Alejandro!

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.