Nginx代理上传文件大小设置
一,安装nginx配置
进入nginx配置文件–>conf–>nginx.conf
#user nobody;
worker_processes 5;
events {worker_connections 10240;
}
rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp_socket_dir /tmp;
rtmp{out_queue 4096;out_cork 8;max_streams 128;log_interval 5s;log_size 1m;server{listen 1935;server_name localhost;application live{live on;gop_cache on;hls on; #这个参数把直播服务器改造成实时回放服务器。wait_key on; #对视频切片进行保护,这样就不会产生马赛克了。hls_path /vrs/trs/vod/mp4/hls; #切片视频文件存放位置。hls_fragment 10s; #每个视频切片的时长。hls_playlist_length 60s; #总共可以回看的事件,这里设置的是1分钟。hls_continuous on; #连续模式。hls_cleanup on; #对多余的切片进行删除。hls_nested on; #嵌套模式。dash on;dash_path /vrs/trs/vod/mp4/dash;}}
}http {include mime.types;default_type application/octet-stream;sendfile on;#配置tomcat(nginx代理)upstream www.xxx.com{ip_hash;server localhost:8080 weight=1; #权重}server{listen 8937;server_name localhost;location / {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-Forwarded-Proto https;client_max_body_size 10240m; #nginx配置上传文件大小(10G)proxy_redirect off;proxy_connect_timeout 240;proxy_send_timeout 240;proxy_read_timeout 240;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";# note, there is not SSL here! plain HTTP is usedproxy_pass http://www.testencode.com;}}server {listen 80;server_name localhost;location / {root /vrs/trs/;index admin/login.html;}location ~ .*.[jsp|do|action]$ { #所有jsp页面以及do/action请求均交由 tomcat处理index index.jsp;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-Forwarded-Proto https;client_max_body_size 10240m; #nginx配置上传文件大小(10G)proxy_redirect off;proxy_connect_timeout 240;proxy_send_timeout 240;proxy_read_timeout 3600;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";# note, there is not SSL here! plain HTTP is usedproxy_pass http://www.trs.com;}location /dwr {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-Forwarded-Proto https;client_max_body_size 1000m;proxy_redirect off;proxy_connect_timeout 240;proxy_send_timeout 240;proxy_read_timeout 240;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";# note, there is not SSL here! plain HTTP is usedproxy_pass http://www.trs.com;}location /webservice {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-Forwarded-Proto https;client_max_body_size 1000m;proxy_redirect off;proxy_connect_timeout 240;proxy_send_timeout 240;proxy_read_timeout 240;# note, there is not SSL here! plain HTTP is usedproxy_pass http://www.trs.com;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|apk|tar.gz)${root /vrs/trs/;expires 30d;}location ~ .*\.(js|css)?${root /vrs/trs/;expires -1;}location /live{ #rtmp转http直播码流flv_live on;chunked_transfer_encoding on; #open 'Transfer-Encoding: chunked' responseadd_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP headeradd_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP headeradd_header Access-Control-Allow-Headers X-Requested-With;add_header Access-Control-Allow-Methods GET,POST,OPTIONS;add_header 'Cache-Control' 'no-cache';}location /dash {root /vrs/trs/vod/mp4/dash;add_header 'Cache-Control' 'no-cache';}location /stat {#configuration of push & pull statusrtmp_stat all;rtmp_stat_stylesheet stat.xsl;}location /stat.xsl {root /usr/local/nginx/nginx-http-flv-module;}location /control {rtmp_control all; #configuration of control module of rtmp}error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}
}
二,重启nginx服务
nginx相关命令:
/usr/local/nginx/sbin/ ./nginx #启动nginx服务
/usr/local/nginx/sbin/ ./nginx -s stop #关闭nginx服务
/usr/local/nginx/sbin/ ./nginx -s reload #重启nginx服务
Nginx代理上传文件大小设置相关推荐
- nginx 限制上传文件大小
目录 前言 client_max_body_size使用说明 语法 示例 上下文 client_max_body_size的作用域 client_max_body_size的`默认值` client_ ...
- Nginx优化上传文件大小的限制client_max_body_size 8m;
安全优化-上传文件大小的限制client_max_body_size 8m; 设置nginx服务允许用户最大上传数据大小 根据业务需求调整上传文件大小限制 设置参数 client_max_body_s ...
- Nginx 配置上传文件大小限制
见下图: client_max_body_size 1024M; 上传文件大小限制 sendfile on; 设置为on表示启动高效传输文件的模式 keepalive_timeout 1800;保持连 ...
- springBoot上传文件大小设置
引用参照:https://blog.csdn.net/xiaoni815/article/details/50525145 纯粹为了记录一下,具体分析见引用链接. 报错上传文件大小受到限制,默认1M. ...
- nginx修改上传文件大小限制
新装了一台服务器,用nginx做代理.突然发现上传超过1M大的客户端文件无法正常上传,于是修改了下nginx的配置. cd /export/servers/nginx/conf/nginx.conf, ...
- 已解决:nginx修改上传文件大小限制
nginx上传文件时候报错 解决 在server里面的server_name下面加上 上传文件的最大限制 client_max_body_size 10M; 重启nginx nginx -s relo ...
- nginx php上传大小设置
来源:http://blog.51yip.com/apachenginx/1751.html 转载于:https://www.cnblogs.com/wuheng1991/p/7366816.html
- nginx上传文件大小
采用nginx作反向代理,出现了一个诡异的问题,小文件可以提交,大文件会报500内部错误.这个是什么原因导致的呢? 查wiki可知,上传文件大小相关的有三个配置 client_body_buffer_ ...
- nginx上传文件大小报错500
采用nginx作反向代理,出现了一个诡异的问题,小文件可以提交,大文件会报500内部错误.这个是什么原因导致的呢? 上传文件大小相关的有三个配置 client_body_buffer_size 配置请 ...
最新文章
- C++对象模型5——类对象的内存布局
- MySQL授权用户及密码恢复设置
- Python机器学习---2.聚类分析代码部分
- 三国杀服务器改名 插图修改,《三国杀》大幅修改的武将——新旧两版,你更喜欢哪一位...
- Hive一些参数设置
- mysql数据库连接锁住_锁mysql方法
- 深圳警方出手!“钱爸爸”涉嫌集资诈骗 已累计冻结2.13亿元
- 查看linux代码版本,如何查看 Linux Mint 版本号和代号 | Linux 中国
- java三次登录锁定_Java基础知识点有哪些 如何快速步入Java行业
- 阿里云windows 2012服务器部署java web程序教程
- Bag-of-words模型
- 云南昭通暴雨强度公式_昆明市暴雨强度公式推算与对比
- c语言的单片机delay延时函数详解
- 手把手教你安装Sketch破解版和measure插件 1
- Java SSM 项目实战 day02 功能介绍,SSM整合,数据库和IDEA的maven工程搭建,产品信息查询和添加
- 5GC NEF网元功能介绍
- 计算机上策略禁止用户安装,Win7系统组策略禁止安装软件、软件安装控制策略禁止方法...
- 解析ICMAX国产存储芯片eMMC和UFS的区别
- 新上线APP如何推广提升排名
- 基于Python,从零开始,裸写一套期权定价程序