NextCloud 配置 LDAP 时出现 OC_JSON 找不到的错误

NextCloud版本:21.0.1

Nginx使用这个配置文件:https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html

增加LDAP/AD整合的时候,error.log文件中出错:
FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class ‘OC_JSON’ not found

搜索到这个帖子:https://github.com/nextcloud/documentation/pull/2197#issuecomment-721432337,修改网站的nginx配置后解决。

...
location ~ \.php(?:$|/) {
    # Required for legacy support
    rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;

    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    set $path_info $fastcgi_path_info;

    try_files $fastcgi_script_name =404;
...

增加了rewrite这一行。