简体   繁体   中英

Nodejs express static folder doesn't works for some files

Hello guys I have a project written in NodeJs, express and AngularJS. the problem I'm facing that my page doesn't find some js and css files in the public static folder and gives 404 error. however, it works for the second half of the files! it's wired it know! that why I'm asking after investigating for long time.

I face this bug only with the online server. ( it work perfectly for all links in my own computer)

the website is: http://alfa-srv.geo2.pl/ then login: admin@geo2.pl password: a

then check the source code of the page you gonna find out that some files works and others doesn't for example: /css/style.css ====>> working /css/isteven-multi-select.css >> NOT working!

Also it looks like the server redirecting to /home page in case of those none found files! to understand what I mean try to open manually http://alfa-srv.geo2.pl/css/isteven-multi-select.css

ls of css folder:

ls -na public/css/
total 1020
drwxr-xr-x 2 0 0 4096 Oct 12 17:43 .
drwxr-xr-x 5 0 0 4096 Oct 13 18:06 ..
-rw-r--r-- 1 0 0 443882 Sep 5 17:02 angular-material.min.css
-rwxr-xr-x 1 0 0 122848 Oct 12 17:43 bootstrap.css
-rw-r--r-- 1 0 0 99548 Oct 12 17:43 bootstrap.min.css
-rw-r--r-- 1 0 0 7267 Oct 12 17:43 isteven-multi-select.css
-rw-r--r-- 1 0 0 354734 Sep 5 17:02 style.css

Any suggestion?

Check the files permissions. maybe node does not have the rights to serve these files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM