Docker Nextcloud 常见问题解决方案

本文介绍了如何在安全连接环境下解决实例生成不安全URL的问题,包括PHP模块的安装、服务器维护窗口设置、Nginx配置调整、OPcache优化以及国际区号设置,以提升网站性能和安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

你正通过安全连接访问你的实例,然而你的实例正生成不安全的 URL

config.php 中添加

'overwriteprotocol' => 'https',

该实例缺少一些推荐的 PHP 模块,强烈建议您安装以下模块以提升性能和兼容性:bz2

参考 Github Issue #2118,进入容器后运行,安装后重启容器

apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/*
docker-php-ext-install bz2

Server has no maintenance window start time configured.

Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks.

参考官方文档,在 config.php 中添加

'maintenance_window_start' => 1,

您的网页服务器未正确设置以解析

您的网页服务器未正确设置以解析 “/.well-known/caldav”,“/.well-known/carddav””/.well-known/webfinger”,”/.well-known/nodeinfo”

修改 Nginx 配置文件

location ^~ /.well-known {
        rewrite ^/\.well-known/host-meta\.json  $scheme://$host:$server_port/public.php?service=host-meta-json  last;
        rewrite ^/\.well-known/host-meta        $scheme://$host:$server_port/public.php?service=host-meta       last;
        rewrite ^/\.well-known/webfinger        $scheme://$host:$server_port/public.php?service=webfinger       last;
        rewrite ^/\.well-known/nodeinfo         $scheme://$host:$server_port/public.php?service=nodeinfo        last;

        location = /.well-known/carddav     { return 301 $scheme://$host:$server_port/remote.php/dav/; }
        location = /.well-known/caldav      { return 301 $scheme://$host:$server_port/remote.php/dav/; }

        try_files $uri $uri/ =404;
    }

或者,在 config.php 中添加

'check_for_working_wellknown_setup' => false,

当前正在使用数据库处理事务性文件锁定,若有内存缓存可用,请进行配置以提升性能

通过进入容器查看 PHP 扩展,发现官方镜像已经安装了 Redis 扩展,则只需在 config.php 中添加

'memcache.local' => '\OC\Memcache\Redis',
'redis' => [
	'host' => 'localhost',
    'port' => 6379,
],
'memcache.locking' => '\OC\Memcache\Redis',

您在安装过程中未设置默认的国际区号

config.php 中添加

'default_phone_region' => 'CN',

The OPcache buffer is nearly full.

The PHP OPcache module is not properly configured. The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply “opcache.memory_consumption” to your PHP configuration with a value higher than “128”

参考Github Issue #1692,进入容器后运行,安装后重启容器

sed -i "s/opcache.interned_strings_buffer=8/opcache.interned_strings_buffer=16/g" /usr/local/etc/php/conf.d/opcache-recommended.ini |grep opcache.interned_strings_buffer /usr/local/etc/php/conf.d/opcache-recommended.ini
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JasperXzy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值