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