首页 > 解决方案 > 网站下载 php 文件而不是加载页面 NGINX

问题描述

我在 Nginx 服务器上的子文件夹下设置了一个网站:https ://pixlgraphx.com/oldwebsite/ 。

网站完美加载主页。在我尝试加载其他页面之前,他们会下载一个 php 文件。

我的 Nginx 配置文件在这里:

location /oldwebsite{
 try_files $uri $uri/ /oldwebsite/index.php$args /oldwebsite/index.php?q=$uri$args;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/pixlgraphx.sock;
fastcgi_index index.php;
fastcgi_read_timeout 180;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param  HTTPS "on";
fastcgi_param  HTTP_X_FORWARDED_PROTO "https";
 client_max_body_size 128M;
}

Nginx 配置文件

Nginx 配置文件 2

Nginx 配置文件 3

标签: phpwordpressnginx

解决方案


推荐阅读