nginx下配置thinkphp文件的方法
更新時(shí)間:2017年01月18日 10:32:37 作者:rdisme
這篇文章主要介紹了nginx下配置thinkphp文件的方法,需要的朋友可以參考下
在上篇文章給大家介紹了在Nginx上部署ThinkPHP項(xiàng)目教程,今天給大家介紹nginx下thinkphp的配置,具體詳解如下:
## domain redirect #if ($host != "my.ruanzhuangyun.cn"){ # rewrite ^/(.*)$ http://my.ruanzhuangyun.cn/$1 permanent; #} ## domain redirect ## tp pathinfo location /data/www/tp.360ruanzhuang/ { index index.php; if (!-e $request_filename) { rewrite ^/data/www/tp.360ruanzhuang/(.*)$ /data/www/tp.360ruanzhuang/index.php/$1 last; break; } } location ~ .+\.php($|/) { set $script $uri; set $path_info "/"; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php?IF_REWRITE=1; include fastcgi_params; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root/$script; fastcgi_param SCRIPT_NAME $script; } ## pathinfo end ## index.php hidden location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } ## index.php hidden }
以上所述是小編給大家介紹的nginx下配置thinkphp文件的方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
詳解nginx.conf 中 root 目錄設(shè)置問(wèn)題
這篇文章主要介紹了詳解nginx.conf 中 root 目錄設(shè)置問(wèn)題,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09詳解NGINX如何統(tǒng)計(jì)網(wǎng)站的PV、UV、獨(dú)立IP
做網(wǎng)站的都知道,平常經(jīng)常要查詢(xún)下網(wǎng)站PV、UV等網(wǎng)站的訪問(wèn)數(shù)據(jù),這篇文章主要介紹了詳解NGINX如何統(tǒng)計(jì)網(wǎng)站的PV、UV、獨(dú)立IP ,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-05-05聊聊配置?Nginx?訪問(wèn)與錯(cuò)誤日志的問(wèn)題
這篇文章主要介紹了配置?Nginx?訪問(wèn)與錯(cuò)誤日志,Nginx是一個(gè)開(kāi)放源代碼的高性能HTTP和反向代理服務(wù)器,負(fù)責(zé)處理Internet上某些最大站點(diǎn)的負(fù)載,對(duì)Nginx?錯(cuò)誤日志相關(guān)知識(shí)感興趣的朋友一起看看吧2022-05-05