nginx - 為什麼瀏覽器裡造訪m.xx.com預設載入了www.xx.com的index.html的快取?
伊谢尔伦
伊谢尔伦 2017-05-16 17:10:28
0
1
648
  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學習者快速成長!