关于NextCloud登录报错:Refused to send form data to '/login' because it violates the following Content Security Policy directive: "form-action 'self'".
0x01 问题描述
部署完nextcloud,点击登录后,一直卡在登录界面,控制台提示:Refused to send form data to '/login' because it violates the following Content Security Policy directive: "form-action 'self'".
0x02 解决方案
把自己的域名加上
cd /nextcloud_data/lib/public/AppFramework/Http
vim ContentSecurityPolicy.php
# 加上网址域名即可
/** @var array Domains which can be used as target for forms */
protected $allowedFormActionDomains = [
'\'self\'','pan.nextcloud.com'
];