vhost配置

server
    {
        listen 80;
        server_name local.*****.com;
        index index.html index.htm index.php;
        root  /home/wwwroot/******/public;

        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

      location / {
            if (!-e $request_filename) {            //~~~~访问可以不加index.php
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
        }


        access_log  /home/wwwlogs/access_dexin.log;
    }

猜你喜欢

转载自www.cnblogs.com/pansidong/p/9706683.html