index index.html index.htm index.php

server {
        listen       80;
        server_name  localhost;
        index index.html index.htm index.php;#前后顺序有关系,越在前优先级别越高
        root /app/www/default;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        include /app/server/nginx/conf/rewrite/default.conf;
        access_log  /app/log/nginx/access/default.log;
#如果的网站的根目录下 有index.html 和index.php的话会显示index.html,不会显示index.php
#如果是  index index.php index.htm index.html;的话并且根目录下同时有index.html和index.php,会显示index.php

 

posted @ 2016-06-30 14:42  bass  阅读(2035)  评论(0编辑  收藏  举报