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

目录
相关文章
|
9月前
|
人工智能 Java
Required request body is missing
Required request body is missing
|
11月前
Warning: [antd: Form.Item] `defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.
Warning: [antd: Form.Item] `defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.
321 0
|
JSON 数据格式
Required request body is missing:415
Required request body is missing:415
Required request body is missing:415
|
JavaScript 前端开发
sendData to ABAP backend via multiple form content type
Created by Jerry Wang, last modified on Aug 20, 2014
sendData to ABAP backend via multiple form content type
How to resolve warning message Access restriction -The type Resource is not accessible
How to resolve warning message Access restriction -The type Resource is not accessible
117 0
How to resolve warning message Access restriction -The type Resource is not accessible
2015-03-19 header note update in my Appointment
Created by Wang, Jerry, last modified on Mar 23, 2015
108 0
2015-03-19 header note update in my Appointment
|
安全
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 ...
3121 0