首頁  >  問答  >  主體

伺服器設定 - nginx如何支援pathinfo模式?

伺服器上安裝了lanp一鍵安裝包,設定nginx支援pathinfo存取模式時一直不成功

过去多啦不再A梦过去多啦不再A梦2693 天前838

全部回覆(2)我來回復

  • phpcn_u1582

    phpcn_u15822017-05-16 17:18:15

    新版本的nginx有一個自帶的函數可以處理pathinfo,如下:

    location ~ .php(.*)$ {
        fastcgi_pass   unix:/tmp/php-cgi.sock;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^(.+.php)(.*)$;
        fastcgi_param   PATH_INFO       $fastcgi_path_info;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
        #include        fastcgi_params;
        include fcgi.conf;
    }

    回覆
    0
  • 某草草

    某草草2017-05-16 17:18:15

    https://xuwenzhi.com/2015/04/05/nginx-%E9%85%8D%E7%BD%AE-pathinfo/

    試試這個。

    回覆
    0
  • 取消回覆