Skip to content
Advertisement

Nginx Returns Welcome Page Inside Docker Using Laravel & Traefik

I’ve setup Docker with a custom Nginx/PHP image for my Laravel app. I’m serving it via Traefik as I’m hosting multiple sites on one machine. Nginx only returns the Welcome to Nginx page when I load up the site. I’ve verified via nginx -T that my Nginx config is setup correctly. I’ve entered the Docker container via terminal and see all my files there. I’ve narrowed the issue down to Traefik – if I remove the Traefik tags and expose a port instead, my site shows up just fine. This is true of identically configured sites not using Traefik. I need to be able to use Traefik but have it return my Laravel app (called Laraview) instead found in src. Thanks for your help! Here is my config:

Dockerfile

JavaScript

nginx.conf

JavaScript

docker-compose

JavaScript

Advertisement

Answer

JavaScript

should be

JavaScript

Also server_name localhost; doesn’t match your hostname in the docker-compose

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement