/xmlrpc.php
我的Drupal 站点上有一条虚拟路由。这是为了旧版兼容性。使用默认的 DDEV 配置,nginx 返回“未指定输入文件”。当我访问https://mysite.ddev.local/xmlrpc.php时。
我怎样才能让它请求 Drupal 来处理请求呢?
/xmlrpc.php
我的Drupal 站点上有一条虚拟路由。这是为了旧版兼容性。使用默认的 DDEV 配置,nginx 返回“未指定输入文件”。当我访问https://mysite.ddev.local/xmlrpc.php时。
我怎样才能让它请求 Drupal 来处理请求呢?
此答案假定使用 DDEV 1.8.0+。
nginx
在项目目录的子文件夹中创建一个新文件.ddev
,例如.ddev/nginx/xmlrpc.conf
. (文件可以任意命名,只要以 . 结尾即可.conf
。)
粘贴以下内容:
# pass the PHP scripts to FastCGI server listening on socket
location = '/xmlrpc.php' {
try_files $uri @rewrite;
}
运行ddev start
以重新创建 Web 容器。
这种模式也用于处理/system/files
路径(用于 Drupal 私有文件)之类的事情,xmlrpc.php
如果真实文件存在,它将更喜欢它,否则将要求 Drupal index.php
(和路由系统)处理请求。