• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

513
Vistas
Bootstrap(Laravel) assets 404-error from Docker(Nginx)

The goal:

Make newly created Laravel6 projects' bootstrap assets layout work from Docker.

Symptoms: Bootstrap assets work properly on local Laravel development environment (XAMPP -Apache- +Win10Pro), both the js and css are loaded well. But does'not work properly from local Docker (Win10-linux containers, Nginx+PHP+MySql+Redis), app.js and app.css runs on error 404.

Apache(local xampp):

enter image description here

Nginx(Docker):

enter image description here

What I did:

  • New Laravel project created, auth added, bootstrap, npm and node installed properly.
  • Virtual Host settings (httpd-vhosts.conf) for Apache in xampp: enter image description here

    • nginx.conf in nginx container

enter image description here

  • Virtual Host settings (default.conf) for Nginx in nginx container: enter image description here

  • .htaccess file in my projectfolder /a_new_app_for_test/public/

enter image description here

  • docker-compose.yml for nginx

enter image description here

  • docker-compose.yml for app

enter image description here

What settings should I add/change in order to make assets loaded correctly?

I suppose it could be related to nginx settings compiled into Docker.

Any help are appreciated.

Thanks in advance.

about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try to copy your whole project to the container volume, this way nginx will be able to see your files from public or resources folder.

volumes:
  - ./:/var/www/
about 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda