nginx 子目录执行php

2021/10/19 7:09:59

本文主要是介绍nginx 子目录执行php,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

location ^~ /sub/ {
set $subroot /home/www/sv8/wwwroot/;
root $subroot;
index index.php index.html;

location ~ \.php {
fastcgi_pass php5:9000;
set $scriptname '';
set $pathinfo '';

if ( $uri ~ ^/sub/(.+\.php)($|/.+) ) {
set $scriptname $1;
set $pathinfo $2;
}

fastcgi_param SCRIPT_FILENAME /home/www/sv8/wwwroot/$scriptname;
fastcgi_index index.php?IF_REWRITE=1;
fastcgi_param PATH_INFO $pathinfo;
include fastcgi_params;
}
}



这篇关于nginx 子目录执行php的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程