歡迎您光臨本站 註冊首頁

nginx報404

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

nginx報404

明明文件存在,怎麼還報404呢???

平台:windows 7
nginx版本:1.0.14
配置文件:

server {
        listen       127.0.0.1:90;
        server_name  123.dev www.123.dev;
    access_log  logs/123.log;
    #autoindex on;
   
        location / {
        root   D:www/shop_php/shop;
        index  index.html index.htm index.php;
            
        }

        location ~ \.php$ {
        root   D:www/shop_php/shop;
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.php;
        include        fastcgi_params;
        }
    #靜態文件,nginx自己處理
        location ~ \.(images|javascript|js|css|flash|media|static)$ {
        root d:www/shop_php/shop;
        #過期30天,靜態文件不怎麼更新,過期可以設大一點,如果頻繁更新,則可以設置得小一點。
        expires 30d;
        }
    error_page   500 502 503 504 /50x.html;  
        location = /50x.html {
        root   D:www/shop_php/shop;
    }
    }

在瀏覽器中輸入:http://127.0.0.1:90/index.php可以打開。

但是http://127.0.0.1:90/css/index.css打不開
《解決方案》

靜態配置下沒這個文件?
《解決方案》

        root d:www/shop_php/shop;
        root   D:www/shop_php/shop;

應該是root的配置文件。
但是 就d和D的區別。

[火星人 ] nginx報404已經有308次圍觀

http://coctec.com/docs/service/show-post-11344.html