nginx – Warum lädt der Browser beim Zugriff auf m.xx.com standardmäßig den index.html-Cache von www.xx.com?
伊谢尔伦
伊谢尔伦 2017-05-16 17:10:28
0
1
685
  1. Verwenden Sie Firefox und Safari

  2. Der Server verwendet NGINX

  3. Die ursprüngliche Konfiguration von www.xx.com existiert bereits

  4. M.xx.com-Konfiguration hinzufügen

  5. Es ist normal, direkt auf http://m.xx.com/index.html zuzugreifen

  6. Besuchen Sie http://m.xx.com und sehen Sie im Browser-Debugging-Tool, dass der Cache von index.html von www.xx.com geladen ist

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伐。

Antworte allen(1)
Peter_Zhu

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

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage