server {
listen 80;
listen [::]:80;
server_name lnmp.org www.lnmp.org;
root /home/wwwroot/nextcloud; add_header X-Content-Type-Options nosniff;
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;
add_header Referrer-Policy no-referrer; # Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By; location = /robots.txt {
allow all;
log_not_found off;
access_log off;
} # The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; # The following rule is only needed for the Social app.
# Uncomment it if you're planning to use this app.
# rewrite ^/.well-known/webfinger /public.php?service=webfinger last; location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
} # set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K; # Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; location / {
rewrite ^ /index.php$request_uri;
} location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
deny all;
}
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
} location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
include fastcgi.conf;
fastcgi_param PATH_INFO $fastcgi_path_info;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
} location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
} # Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
add_header X-Content-Type-Options nosniff;
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;
add_header Referrer-Policy no-referrer;
access_log off;
} location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$request_uri;
access_log off;
}
}

https://bbs.vpser.net/thread-18445-1-1.html

上传和下载优化

1. 修改php配置文件php.ini;

post_max_size = 500M;
upload_max_filesize = 500M;
memory_limit = 500M;
max_execution_time = 3600;
max_input_time = 3600; 2. 修改nginx的配置文件 client_max_body_size 500M;
client_header_timeout 3600s;
client_body_timeout 3600s;
fastcgi_connect_timeout 3600s;
fastcgi_send_timeout 3600s;
fastcgi_read_timeout 3600s;
# 其他webserver相应修改类似限制;如apache需要修改LimitRequestBody

http://doc.kodcloud.com/v2/#/help/options?id=%e4%b8%80%e3%80%81%e4%b8%8a%e4%bc%a0%e4%b8%8b%e8%bd%bd%e9%80%9f%e5%ba%a6%e4%bc%98%e5%8c%96

NextCloud 在lnmp下 nginx 的配置的更多相关文章

  1. LNMP下Nginx 中文文件名或目录404无法访问的解决方法

    貌似很多人还是会遇到中文乱码的问题,Apache可以使用mod_encoding支持中文目录和文件,LNMP下Nginx其实不需要安装额外的组件即可支持中文文件名或中文目录,下面说一下常见的CentO ...

  2. VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)

    首先启动Nginx 1. 相关浏览 两个 Tomcat 配置:  VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...

  3. VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二)

    准备工作 相关浏览: VMware Linux 下 Nginx 安装配置 (一) 1. 选在 /usr/local/ 下创建 softs 文件夹,通过 ftp 命令 把 apache-tomcat-7 ...

  4. Windows下Nginx的配置及配置文件部分介绍

    一.在官网下载 nginx的Windows版本,官网下载:http://nginx.org/download/ 选择你自己想要的版本下载,解压 nginx(例如nginx-1.6.3) 包到你的win ...

  5. centos7下nginx安全配置

    Linux服务器下nginx的安全配置   1.一些常识 linux下,要读取一个文件,首先需要具有对文件所在文件夹的执行权限,然后需要对文件的读取权限. php文件的执行不需要文件的执行权限,只需要 ...

  6. windows下nginx的配置

    这里做的nginx的配置主要的功能是: 能够用localhost访问本地文件夹中的项目 输入ip地址访问本地文件夹中的项目 反向代理其他地址访问本地文件 1.nginx安装地址 2.解压之后的文件如下 ...

  7. windows下nginx中配置端口转发 ----本文来自转载

    什么是端口转发 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 转载原文链接:https://www.cnblogs.com/chanshuyi/ ...

  8. 从零开始学 Java - CentOS 下 Nginx + Tomcat 配置负载均衡

    为什么现在有非常多的聪明人都在致力于互联网? 最近在读埃隆·马斯克传记,他说「我认为现在有非常多的聪明人都在致力于互联网」. 仔细一想,好像真的是这样的. 我问了自己一个问题:如果你不敲代码了,你能做 ...

  9. Linux学习总结(16)——CentOS 下 Nginx + Tomcat 配置负载均衡

    最近在读埃隆·马斯克传记,他说「我认为现在有非常多的聪明人都在致力于互联网」. 仔细一想,好像真的是这样的. 我问了自己一个问题:如果你不敲代码了,你能做什么? 答案令人极其恐怖.吓得我赶紧又去写了一 ...

  10. lnmp下 nginx 配置虚拟主机

    <一.参考> 这里以配置2个站点(2个域名)为例,n 个站点可以相应增加调整,假设: IP地址: 202.55.1.100 域名1 example1.com 放在 /www/example ...

随机推荐

  1. C#和C++差异化对比

    这里只记录和C++面向对象的区别,也并无比较成分,只做差异化学习使用. 1. 访问修饰符区别:多了一个Internal:成员仅能被同一个项目中的代码访问. 2. 字段的访问:增加了Get,Set访问器 ...

  2. unity shader 描边

    https://zhuanlan.zhihu.com/p/66282034   这个是将整个模型放大 在世界坐标操作 https://blog.csdn.net/ToToTofu/article/de ...

  3. scroll-view 横向滚动无效

    scroll-view的内层view元素需要: display: inline-block scroll-view的外层元素需要: white-space: nowrap 使得内部组件不换行.

  4. Promise 一些注意点

    Promise是一个构造函数,其身上有all.race.resolve.reject这些方法,都可以通过 Promise. 调用. 注意点1 Promise构造函数接受一个参数 => funct ...

  5. java 为 枚举类型euum 的 某个int(Integer)字段做自增 Identity

    前人所做的 java中枚举类型的自增: 链接 : https://www.h5w3.com/177055.html 1 enum MSG_TYPE { 2 MSG_LOGIN(500), 3 MSG_ ...

  6. CV入坑

    https://www.cnblogs.com/fldev/p/14360149.html

  7. C#实现控制台打印年历

    C#实现控制台打印年历 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System. ...

  8. 例题1:shell脚本

    题目总结: 1.搜索子域名的shell脚本 2.嗅探并抓去网页快照shell脚本 3.漏洞利用程序下载脚本 题目一:依次输入以下代码即可: 1.wget www.megacorpone.com  2. ...

  9. 样例1-http接口的waiting(TTFB)时间从5.5s优化为100ms

    问题 :如何解决网页响应慢,waiting(TTFB)时间过长,接口返回耗时等问题? 首先需要了解什么是Waiting (TTFB) 时间?TTFB 是Time to First Byte 的缩写,指 ...

  10. 《MySQL是怎样运行的》第七章小结