我有两个应用程序:一个写在php5.5上,另一个写在php8.0上。当我尝试在nginx中设置分离的php-cgi块时-所有请求都由php5.5处理。看起来php5.5定义覆盖了php8.0或idk
server
{
listen 80 default_server;
listen [::]:80 default_server;
server_name $NGINX_HOST;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html;
location ~ ^/reports
{
#root /var/www/html;
alias /var/www/html/;
try_files $uri =404;
location ~ \.php$
{
fastcgi_pass php8.0:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
location /
{
alias /var/www/html/oldSystem;
try_files $uri /index.php;
location ~ \.php$
{
fastcgi_pass php5.5:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
我尝试使用继承位置,移动位置和做其他东西没有任何效果
1条答案
按热度按时间gwbalxhn1#
还有日志中的错误: