Chinaunix

标题: nginx报404 [打印本页]

作者: xubaoguo    时间: 2013-07-04 15:25
标题: 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打不开
作者: wenhq    时间: 2013-07-04 21:35
静态配置下没这个文件?

作者: maochanglu    时间: 2013-07-07 09:17
        root d:www/shop_php/shop;
        root   D:www/shop_php/shop;

应该是root的配置文件。
但是 就d和D的区别。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2