nginx - 为什么浏览器里访问m.xx.com默认加载了www.xx.com的index.html的缓存?
伊谢尔伦
伊谢尔伦 2017-05-16 17:10:28
0
1
652
  1. 浏览器使用Firefox和Safari

  2. 服务器使用NGINX

  3. 原已存在www.xx.com的配置

  4. 添加m.xx.com的配置

  5. 直接访问http://m.xx.com/index.html是正常的

  6. 访问http://m.xx.com,从浏览器调试工具里看到,加载了www.xx.com的index.html的缓存

server{
        listen  80;
        server_name     www.xx.com;
        root /Users/jim/Sites/xx/public;
        index   index index.html index.php index.htm;

        location / {
                if (!-e $request_filename) {
                        rewrite ^/index.php(.*)$ /index.php?s= last;
                        rewrite ^(.*)$ /index.php?s= last;
                        break;
                }
        }

       location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
    }
server{
        listen  80;
        server_name     m.xx.com;
        root /Users/monk/Sites/xx/mobile;
        index   index index.html index.php index.htm;

        location / {
                if (!-e $request_filename) {
                        rewrite ^/index.php(.*)$ /index.php?s= last;
                        rewrite ^(.*)$ /index.php?s= last;
                        break;
                }
        }

       location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
    }
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回复(1)
Peter_Zhu

应该是配置问题,贴出来看看吧

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!