LNMP 基于域名的虚拟主机配置 (Centos5.6)

.

.

server
    {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;
        server_name www.blog.com;
        index index.html index.htm index.php;
        root  /home/wwwroot/blog/public;


        #error_page   404   /404.html;
        include enable-php.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;
        }

        access_log  /home/wwwlogs/access.www.blog.com.log  access;
    }

server
    {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;
        server_name www.yiibasic.com;
        index index.html index.htm index.php;
        root  /home/wwwroot/yiibasic/web;


        #error_page   404   /404.html;
        include enable-php.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;
        }

        access_log  /home/wwwlogs/access.www.yiibasic.com.log  access;
    }

 

.

 

posted @ 2015-12-24 16:48  九分  阅读(254)  评论(0编辑  收藏  举报