thinkphp3.2.2配置nginx(需配置URL_MODEL=>2)

server {
        listen       80;
        server_name  sxt.cn ;#填寫你的域名
        index index.html index.htm index.php;#默認打開頁面
        root   "D:/Tools/phpStudy8.0/phpstudy_pro/WWW/shengxintai";#你的index.php路徑
        
        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;
        }
        
        location /
        {
                #如果是二級目錄就用 rewrite ^/文件夾名稱/(.*)$ /index.php?s=/$1 last;)
            if (!-e $request_filename)
            {
                rewrite ^(.*)$ /index.php?s=/$1 last;
                break;
            }
        }

}

發佈了37 篇原創文章 · 獲贊 2 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章