zoukankan      html  css  js  c++  java
  • 不同的域名可以指向同一个项目

    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

  • 相关阅读:
    JavaScript将数字转换为大写金额
    css浮动
    JS合并数组的几种方法及优劣比较
    jquery.zclip.js粘贴功能
    iframe获取元素
    某些框架,类库
    web前端基础知识!
    前端开发流程
    学习其他前端技术
    SVN的学习以及使用!
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/9768092.html
Copyright © 2011-2022 走看看