This commit is contained in:
dami
2026-10-17 14:07:59 +08:00
parent 7260a2be21
commit d1da238ddc
6 changed files with 0 additions and 83 deletions
@@ -1,3 +0,0 @@
upstream MW-UPSTREAM-RAPIRA{$PHP_VERSION} {
server unix:/tmp/rapira-cgi-{$PHP_VERSION}.sock;
}
-10
View File
@@ -1,10 +0,0 @@
set $PHP_ENV 1;
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
#fastcgi_pass unix:/tmp/rapira-cgi-{$PHP_VERSION}.sock;
fastcgi_pass MW-UPSTREAM-RAPIRA{$PHP_VERSION};
fastcgi_index index.php;
include fastcgi.conf;
include {$SERVER_PATH}/web_conf/php/pathinfo.conf;
}
-11
View File
@@ -1,11 +0,0 @@
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
#修复http3不传HOST问题
fastcgi_param HTTP_HOST $host;
-4
View File
@@ -1,4 +0,0 @@
location /{$PHP_VERSION} {
root {$ROOT_PATH}/phpinfo;
include {$SERVER_PATH}/web_conf/php/conf/enable-php-rapira{$PHP_VERSION}.conf;
}
-5
View File
@@ -1,5 +0,0 @@
location /rapira_status_{$PHP_VERSION} {
fastcgi_pass unix:/tmp/rapira-cgi-{$PHP_VERSION}.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$fastcgi_script_name;
}
-50
View File
@@ -159,55 +159,6 @@ def contentReplace(content, version):
return content
def makeOpenrestyConf():
phpversions = ['84','85']
sdir = mw.getServerDir()
dst_dir = sdir + '/web_conf/php'
if not os.path.exists(dst_dir):
mw.execShell('mkdir -p ' + dst_dir)
dst_dir_conf = sdir + '/web_conf/php/conf'
if not os.path.exists(dst_dir_conf):
mw.execShell('mkdir -p ' + dst_dir_conf)
dst_dir_upstream = sdir + '/web_conf/php/upstream'
if not os.path.exists(dst_dir_upstream):
mw.execShell('mkdir -p ' + dst_dir_upstream)
dst_pathinfo = sdir + '/web_conf/php/pathinfo.conf'
if not os.path.exists(dst_pathinfo):
src_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
shutil.copyfile(src_pathinfo, dst_pathinfo)
info = getPluginDir() + '/info.json'
content = mw.readFile(info)
content = json.loads(content)
versions = content['versions']
tpl = getPluginDir() + '/conf/enable-rapira.conf'
tpl_content = mw.readFile(tpl)
for x in phpversions:
dfile = sdir + '/web_conf/php/conf/enable-php-rapira' + x + '.conf'
if not os.path.exists(dfile):
if x == '00':
mw.writeFile(dfile, '')
else:
content = contentReplace(tpl_content, x)
mw.writeFile(dfile, content)
upstream_tpl = getPluginDir() + '/conf/enable-rapira-upstream.conf'
upstream_tpl_content = mw.readFile(upstream_tpl)
for x in phpversions:
dfile = sdir + '/web_conf/php/upstream/enable-php-rapira' + x + '.conf'
if not os.path.exists(dfile):
if x == '00':
mw.writeFile(dfile, '')
else:
content = contentReplace(upstream_tpl_content, x)
mw.writeFile(dfile, content)
def phpPrependFile(version):
app_start = getServerDir() + '/app_start.php'
if not os.path.exists(app_start):
@@ -238,7 +189,6 @@ def commonReplace(content,version):
return content
def initReplace(version):
makeOpenrestyConf()
initD_path = getServerDir() + '/init.d'
# if not os.path.exists(initD_path):
# os.mkdir(initD_path)