NextCloud 在lnmp下 nginx 的配置
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
NextCloud 在lnmp下 nginx 的配置的更多相关文章
- LNMP下Nginx 中文文件名或目录404无法访问的解决方法
貌似很多人还是会遇到中文乱码的问题,Apache可以使用mod_encoding支持中文目录和文件,LNMP下Nginx其实不需要安装额外的组件即可支持中文文件名或中文目录,下面说一下常见的CentO ...
- VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)
首先启动Nginx 1. 相关浏览 两个 Tomcat 配置: VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...
- VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二)
准备工作 相关浏览: VMware Linux 下 Nginx 安装配置 (一) 1. 选在 /usr/local/ 下创建 softs 文件夹,通过 ftp 命令 把 apache-tomcat-7 ...
- Windows下Nginx的配置及配置文件部分介绍
一.在官网下载 nginx的Windows版本,官网下载:http://nginx.org/download/ 选择你自己想要的版本下载,解压 nginx(例如nginx-1.6.3) 包到你的win ...
- centos7下nginx安全配置
Linux服务器下nginx的安全配置 1.一些常识 linux下,要读取一个文件,首先需要具有对文件所在文件夹的执行权限,然后需要对文件的读取权限. php文件的执行不需要文件的执行权限,只需要 ...
- windows下nginx的配置
这里做的nginx的配置主要的功能是: 能够用localhost访问本地文件夹中的项目 输入ip地址访问本地文件夹中的项目 反向代理其他地址访问本地文件 1.nginx安装地址 2.解压之后的文件如下 ...
- windows下nginx中配置端口转发 ----本文来自转载
什么是端口转发 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 转载原文链接:https://www.cnblogs.com/chanshuyi/ ...
- 从零开始学 Java - CentOS 下 Nginx + Tomcat 配置负载均衡
为什么现在有非常多的聪明人都在致力于互联网? 最近在读埃隆·马斯克传记,他说「我认为现在有非常多的聪明人都在致力于互联网」. 仔细一想,好像真的是这样的. 我问了自己一个问题:如果你不敲代码了,你能做 ...
- Linux学习总结(16)——CentOS 下 Nginx + Tomcat 配置负载均衡
最近在读埃隆·马斯克传记,他说「我认为现在有非常多的聪明人都在致力于互联网」. 仔细一想,好像真的是这样的. 我问了自己一个问题:如果你不敲代码了,你能做什么? 答案令人极其恐怖.吓得我赶紧又去写了一 ...
- lnmp下 nginx 配置虚拟主机
<一.参考> 这里以配置2个站点(2个域名)为例,n 个站点可以相应增加调整,假设: IP地址: 202.55.1.100 域名1 example1.com 放在 /www/example ...
随机推荐
- 十大经典排序之桶排序(C++实现)
桶排序 桶排序是计数排序的升级版.它利用了函数的映射关系,高效与否的关键就在于这个映射函数的确定 思路: 根据数据规模,初始化合理桶数 将数列中的数据按照桶的规模进行映射,尽量保证数据被均匀的分布到桶 ...
- 关于ADB命令工具
android提供了不少命令行工具,方便我们调试和查看信息.下面是frameworks/base/cmds(android 6.0.1)中的命令. $ tree cmds -L 1 cmds am├─ ...
- 精通Spring 4.x 企业应用开发实战 文档链接总结
Spring在线文档 http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle
- cmake使用boost静态库,错误提示 Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.48")
使用的是Cmake-gui 编译. 问题出在C盘路径下找不到 Boost ,是否需要把boost的路径添加到系统Path 中? 任然不能解决. 更改源码: 找到下面这几行代码(你可以搜索) messa ...
- ABP vNext微服务架构详细教程——项目部署
1. 基础配置 在之前的文章中,我们已经配置了Kubernetes集群并安装了管理工具Kubesphere,文章地址为:https://mp.weixin.qq.com/s/MgpdMv5A-fYxN ...
- springboot后端接收不到前端传来的表单值
为啥接收不到 因为传来的字段值太大了,springboot默认启动依赖tomcat,tomcat默认接收表单值最大为2MB,将server.tomcat.max-http-form-post-size ...
- MQ(部署模式)
MQ部署模式 1.master-slave部署模式 1)shared filesystem Master-Slave部署方式 主要是通过共享存储目录来实现master和slave的热备,所有的Acti ...
- 深入理解 Python 虚拟机:整型(int)的实现原理及源码剖析
深入理解 Python 虚拟机:整型(int)的实现原理及源码剖析 在本篇文章当中主要给大家介绍在 cpython 内部是如何实现整型数据 int 的,主要是分析 int 类型的表示方式,分析 int ...
- VMware虚拟机扩容--保姆级教学
由于项目逐步的完善,需要搭建的中间件,软件越来越多,导致以前虚拟机配置20G的内存不够用了,又不想重新创建新的虚拟机,退而求更精,选择扩容. 1.外部先进入虚拟机设置,将磁盘先扩展,具体提示如下图所示 ...
- TSCTF-J 2022 WP
Re baby_xor 加密逻辑如上,密文动态调试,然后 Shift+E 导出密文[这样避免了手动获取] # encoding=utf-8 enc=[ 0x12, 0x00, 0x00, 0x00, ...