Refused to send form data to ××; because it violates the following Content Security Policy directive: "form-action 'self'"

简介: 常见问题

今天做云服务器的http变更成https,但是做完之后,发现登录页面有问题,无法直接条转需要刷新才能解决,查看了报错信息

image.png

百度了一下原因,是因为拒绝将表单数据发送到“域”,因为它违反了以下内容安全策略指令

解决办法:

cd /var/www/nextcloud/lib/public/AppFramework/Http

vim ContentSecurityPolicy.php

在下面的对应位置加上网址域名即可

/** @var array Domains which can be used as target for forms */

protected $allowedFormActionDomains = [

'\'self\'','https://擦汗.ABC.com',

       ];

备注:红色新添加地方为您的https地址

image.png

同时修改/var/www/nextcloud/config/config.php

添加:

 'overwriteprotocol' => 'https',

1666948023371.jpg

第二个问题

redis缓存问题

apt install php-apcu

service apache2 restart

同时修改/var/www/nextcloud/config/config.php

添加:

 'memcache.local' => '\OC\Memcache\APCu',

image.png

service apache2 restart

目录
相关文章
|
6月前
|
JSON Java 数据格式
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
673 0
head 插件 Content-Type header [application/x-www-form-urlencoded] is not supported
head 插件 Content-Type header [application/x-www-form-urlencoded] is not supported
134 1
|
6月前
使用Form报错提示If ngModel is used within a form tag, either the name attribute must be set or the form
使用Form报错提示If ngModel is used within a form tag, either the name attribute must be set or the form
|
人工智能 Java
Required request body is missing
Required request body is missing
203 0
|
JSON 数据格式
Required request body is missing:415
Required request body is missing:415
Required request body is missing:415
|
测试技术
SAP IDoc 报错- Function module not allowed SPEIDOC_INPUT_DESADV1 –
SAP IDoc 报错- Function module not allowed SPEIDOC_INPUT_DESADV1 –
SAP IDoc 报错- Function module not allowed SPEIDOC_INPUT_DESADV1 –
|
XML Java 数据库连接
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
201 0
Open quote is expected for attribute "{1}" associated with an element type "id".
Unable to add window --token is not valid
Unable to add window --token is not valid
|
安全
Refused to load the script because it violates the following Content Security Policy directive: "scr
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80441748 ...
3365 0