Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

572
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda