nginx下配置thinkphp文件的方法
更新時間:2017年01月18日 10:32:37 作者:rdisme
這篇文章主要介紹了nginx下配置thinkphp文件的方法,需要的朋友可以參考下
在上篇文章給大家介紹了在Nginx上部署ThinkPHP項目教程,今天給大家介紹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文件的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
詳解nginx.conf 中 root 目錄設(shè)置問題
這篇文章主要介紹了詳解nginx.conf 中 root 目錄設(shè)置問題,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09
詳解NGINX如何統(tǒng)計網(wǎng)站的PV、UV、獨立IP
做網(wǎng)站的都知道,平常經(jīng)常要查詢下網(wǎng)站PV、UV等網(wǎng)站的訪問數(shù)據(jù),這篇文章主要介紹了詳解NGINX如何統(tǒng)計網(wǎng)站的PV、UV、獨立IP ,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-05-05

