search

Home  >  Q&A  >  body text

php - centos environment laravel5.4 css, js, image error 404

Deploy the laravel5.4 project to the Linux environment, and all css, js, and images will report errors 404.

My project directory is: /usr/local/nginx/html/oshop.

Code: (I introduced /public/css/index/base.css [as an example])

This is .blade.php:

This is the static file directory under public:

This is the error message of the access error:

If you access this css file, the error message is as follows:

Then I wondered if it was a problem with my nginx configuration:

This is my nginx.conf file:

Now I want to know what is the reason for this error? How to fix this error?

Thank you, Code happy!

黄舟黄舟2740 days ago739

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-06-29 10:09:56

    Resource files in Laravel are dynamically loaded and need to be replaced by templates:

    <link ..... href="{{URL::asset('css/....')}}">

    reply
    0
  • 巴扎黑

    巴扎黑2017-06-29 10:09:56


    Try removing this comment

    reply
    0
  • Cancelreply