码迷,mamicode.com
首页 > 其他好文 > 详细

不同的域名可以指向同一个项目

时间:2018-10-10 19:23:15      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:min   .com   ati   request   file   serve   实践   drag   conf   

server{
        listen 80;
        server_name www.hello.com;
        index index.html index.htm index.php admin.php;
        root  /home/wwwroot/default/dexin/dragon/public;

        #error_page   404   /404.html;
        #include enable-php.conf;
        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) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
        }

        access_log  /home/wwwlogs/access.log;
}
server{
        listen 80;
        server_name www.world.com;
        index index.html index.htm index.php admin.php;
        root  /home/wwwroot/default/dexin/dragon/public;

        #error_page   404   /404.html;
        #include enable-php.conf;
        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) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
        }

        access_log  /home/wwwlogs/access.log;
}

实践证明,这两个域名都可以访问同一个资源。
www.hello.com
www.world.com

不同的域名可以指向同一个项目

标签:min   .com   ati   request   file   serve   实践   drag   conf   

原文地址:https://www.cnblogs.com/jiqing9006/p/9768092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!