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

691
Views
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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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/
over 4 years ago · Santiago Trujillo Report
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!