php - 网站下载 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;
}
解决方案
推荐阅读
- python - PermissionError: [Errno 13] - 我在尝试使用来自 Github 的“brownie”包时在我的 Ubuntu/WSL 设置中遇到了这个错误
- javascript - 在 svelte 中将值从子级传递给父级 - 绑定指令的直觉
- api - 我不想清除柏树中的现金和饼干
- python - 如何在python中生成独特的彩色图像
- flutter - 按下时浮动操作按钮的奇怪背景形状
- java - 3D对象SceneView Sceneform android的CameraPreview
- wordpress - wordpress 网站 url 上的前缀导致 404 错误
- javascript - 悬而未决的承诺已取消
- pcregrep - Pcregrep Perl 正则表达式积极的后视
- c - 接收缓冲区数据时套接字错误 10054 - winsock2.h 库