Skip to content
Advertisement

Laravel and Nginx static files

So I am having a problem with getting Nginx to serve static files for my Laravel app. I can see in chrome’s dev tools that the requests are being made to the path, where those files should be (http://mywebsite.com/public/css/style.css). But they are not being loaded at all. I’ve tried getting it to work in a lot of ways, but it just doesn’t seem to do the job. Could anyone help me with that? Cheers!

JavaScript

Basically, there’s a lot of files in /public directory that are not loading, but should be. Like for example css, js, html files for angular templates etc…

Advertisement

Answer

As Kyslik hinted, this could be a permission problem.

I had a similar problem, running Laravel on Homestead on Windows 10. In my case, I could access the files from publiccss directory, but not from publiccssvendor. I realized that I created the vendor directory from Windows, and as a result, the files in it were not accessible by ngingx.

To fix the issue I deleted the vendor directory and recreated it from within the vagrant box.

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