nginx服务器除了更目录可以访问,其他都出现404


配置如下:

listen        80; server_name www.hongtaofei.com; location / { root /home/www/shop/public; index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string; if (!-e $request_filename){ rewrite ^/(.*) /index.php last; } } location ~ \.php$ { root /home/www/shop/public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } --------------------- **注意:这是个人写的配置,一定要加try_files $uri $uri/ /index.php?$query_string 这行**


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM