After the configuration of Nginx, the PHP project put up, found that Css,js and pictures all access, has been redirected to the root directory to perform index.php, depressed on-line search for a half-day, the original different suffix file access to the nginx.conf in the Declaration of rules, such as the next,
Location ~*. (Jpg|gif|png|js|css) $ {root E:\Project\PHP\mobao; if (-F $request _filename) {Expires max;break;}}
In the location ~ \.php$ front with the above rules, restart Nginx, refresh the page, Access success!!!
Location ~*. (jpg|gif|png|js| CSS) $ { root E:\Project\PHP\mobao; if (-F $request _filename) { expires max; Break ; } } ~ \.php$ { #root html; Fastcgi_pass 127.0. 0.1:9009; Fastcgi_index index.php; ...
If it is only the root directory home index.php can access, other page 404, please see my other blog post http://www.cnblogs.com/cxscode/p/6978428.html
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Nginx access CSS JS pictures and other static resources, reported 404 or cannot be directed to access to