add_header Strict-Transport-Security "max-age=15768000;includeSubDomains; preload;";add_header X-Content-Type-Options nosniff;add_header X-Frame-Options "SAMEORIGIN";add_header X-XSS-Protection "1; mode=block";add_header X-Robots-Tag none;add_header X-Download-Options noopen;add_header X-Permitted-Cross-Domain-Policies none;
access_log off;}location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {try_files $uri /index.php$uri$is_args$args;
access_log off;}}
vim nginx.conf
include nextcloud.conf;
service nginx start
8.配置php上传大小
vim /etc/php.ini
max_execution_time = 0
post_max_size = 512M
upload_max_filesize = 512M
service php-fpm start
9.配置nextcloud
10.nextcloud 配置redis缓存
使用Redis做内存缓存可以有效提升程序运行速度。
curl -O
tar -zxvf redis-3.2.8.tar.gz
cd redis-3.2.8/deps/
make geohash-int hiredis jemalloc linenoise lua
cd ..
make && make install
cd utils/
./install_server.sh
配置redis
vim /etc/redis/6379.conf# requirepass foobared
requirepass ExpvUwNOk9XRawC8
bind 192.168.40.200
启动
redis-server /etc/redis/6379.conf
配置nextcloud
cd /usr/local/nginx/html/nextcloud/config
vim config.php
'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
'host' => '192.168.40.200',
'port' => 6379,
'password' => 'ExpvUwNOk9XRawC8',
),
刷新页面
设置定时
*/15 * * * * /usr/bin/php /usr/local/nginx/html/nextcloud/cron.php >/dev/null
参考文档
https://docs.nextcloud.com/server/10/admin_manual/installation/index.html