Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

574
Views
Laravel 5XX errors are intercepted as 502 Bad Gateway in NginX with PHP-FPM running in Docker

I used this guide to setup my local development environment using NginX / PHP-FPM in docker containers: https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose

The app runs perfectly fine and this setup actually helped me solved permission issue that comes from running Laravel app in Docker on Linux OS. My headache at the moment is; when ever there is a laravel error (e.g. route not defined, or some exception occurs), I see this error message:

502 Bad Gateway

However, if I tail my container logs (with the command: docker-compose logs -f --tail=100) I can see the real error that is normally displayed in browser:

my-app          | NOTICE: PHP message: [2020-04-21 23:43:16] local.ERROR: Route [vendor.dashboard] not defined. {"userId":6,"exception":"[object] (Symfony\\Component\\Routing\\Exception\\RouteNotFoundException(code: 0): Route [vendor.dashboard] not defined. at /var/www/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:420)
my-app          | [stacktrace]
my-app          | #0 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php(176): Illuminate\\Routing\\UrlGenerator->route('vendor.dashboar...', Array)
etc...

Any idea why this might be? How do I get the errors from my laravel app to show up normally in local dev? (P.S. debug is enabled in laravel via env)

OS: Kubuntu 20.x / Laravel 7.x / PHP 7.x / Nginx 1.x

Here are some files from my setup that might be of interest:

  • docker-compose.yml
  • Dockerfile
  • nginx/conf.d/app.conf
  • php/local.ini (verified this is loaded by checking phpinfo() call)
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!