【发布时间】:2014-12-03 09:55:00
【问题描述】:
我的配置中有以下 nginx 服务器块
server {
listen 80;
server_name mydomain.com;
location /deploy {
alias /home/somedir/deploy/;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我想在 url mydomain.com/deploy/erp/index.php 或 mydomain.com/deploy/erp 处执行一个 php 文件
上面的东西是下载php文件而不是执行它。我搜索并找到了要求您定义 www 目录或其他内容的解决方案。我只需要在特定 url 的特定目录中执行文件。我有哪些选择?
【问题讨论】:
-
查看我的编辑...不起作用。我现在得到了 404!