[英]nginx is downloading some files instead of executing them
For some reason, my nginx installation is running some .php
files properly, while doesn't.出于某种原因,我的 nginx 安装正确运行了一些
.php
文件,而没有。
I have some files:我有一些文件:
I have no idea what could cause this issue.我不知道是什么导致了这个问题。
I tried:我试过:
Related nginx config part:相关的 nginx 配置部分:
root /boot/www;
index index.html index.php;
server_name - my domain here -;
location / {
try_files $uri $uri/ =404;
}
location /upload.php {
include php5.conf;
}
location /asdfsda.php {
include php5.conf;
}
location /popup.php {
include php5.conf;
}
location /sig.php {
include php5.conf;
}
php5.conf: php5.conf:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
This issue started today, I didn't change anything in my config files recently.这个问题从今天开始,我最近没有更改配置文件中的任何内容。
It worked fine yesterday.昨天效果很好。
I'll appreciate any help, thanks!我将不胜感激任何帮助,谢谢!
UPDATE: If I change the name of asdfsda.php
file that doesn't execute to something else, it actually does execute.更新:如果我将不执行的
asdfsda.php
文件的名称更改为其他名称,它实际上会执行。 For example, I renamed it to d.php
and changed the config entry from asdfsda
to d
and it executed.例如,我将其重命名为
d.php
并将配置条目从asdfsda
为d
并执行。
What is wrong?怎么了?
Why not use this?为什么不使用这个?
location ~ ^/(upload|asdfsda|popup|sig)\.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.