首頁  >  問答  >  主體

nginx - 為什麼瀏覽器裡造訪m.xx.com預設載入了www.xx.com的index.html的快取?

  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;
        }
    }
伊谢尔伦伊谢尔伦2714 天前654

全部回覆(1)我來回復

  • 天蓬老师

    天蓬老师2017-05-16 17:12:28

    應該是設定問題,貼出來看看吧

    回覆
    0
  • 取消回覆