修改配置文件

location ~ ^/(admin|excel|app-download|file)/(.*)$ {proxy_next_upstream http_404 http_500 http_502 http_503 http_504 error timeout invalid_header;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $remote_addr;proxy_set_header Host $host;proxy_read_timeout 60s;proxy_connect_timeout 60s;proxy_send_timeout 60s;proxy_pass http://dm_server/dmback/$1/$2?$args;}

其中 location 用了正则表达式(参考教程:https://www.jianshu.com/p/9fd2ea5b7d12   https://www.runoob.com/regexp/regexp-metachar.html)

~ ^/(admin|excel|app-download|file)/(.*)$ 

波浪号(~):表示执行正则匹配,但区分大小写
小括号():(pattern),匹配 pattern 并获取这一匹配
竖线(|):x|y,匹配 x 或 y

整体表示: 搜索location里包含 admin|excel|app-download|file 的地址,区分大小写其中3个关键参数
proxy_connect_timeout 60s;nginx 与 upstream server 的连接超时时间,默认为 60s;根据应用不同可配置

Syntax:  proxy_connect_timeout time;
Default:
proxy_connect_timeout 60s;
Context:    http, server, location
Defines a timeout for establishing a connection with a proxied server. It should be noted that this timeout cannot usually exceed 75 seconds.

proxy_read_timeout 60s;nginx 接收 upstream server 数据超时, 默认 60s, 如果连续的 60s 内没有收到 1 个字节, 连接关闭;

Syntax:  proxy_read_timeout time;
Default:
proxy_read_timeout 60s;
Context:    http, server, location
Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.

proxy_send_timeout 60s;nginx 发送数据至 upstream server 超时, 默认 60s, 如果连续的 60s 内没有发送 1 个字节, 连接关闭;

Syntax:  proxy_send_timeout time;
Default:
proxy_send_timeout 60s;
Context:    http, server, location
Sets a timeout for transmitting a request to the proxied server. The timeout is set only between two successive write operations, not for the transmission of the whole request. If the proxied server does not receive anything within this time, the connection is closed.

官方文档:http://nginx.org/en/docs/http/ngx_http_proxy_module.html

其中关键是 proxy_read_timeout,proxy_connect_timeout

因为之前是proxy_read_timeout 设置为30s,proxy_connect_timeout为10秒

改大就行,最终我改为300s

上传大文件超时upstream timed out ,nginx配置修改相关推荐

  1. Nginx 上传大文件超大超时解决办法

    问题:用nginx作代理服务器,上传大文件时(本人上传8M左右的文件),提示上传超时或文件过大. 浏览器调试报413 (Request Entity Too Large)错误,如下图所示 原因是ngi ...

  2. [转载自简书] ASPNetCore上传大文件碰到的一些问题总结

    上传大文件碰到不少问题,总结一下. 先介绍一下功能:ajax上传文件到NetCore的web api接口, 安装在Linux服务器的服务端通过Nginx接受到后再存到文件服务器上. 如果文件不大,这个 ...

  3. nginx php大文件上传,Nginx+PHP上传大文件设置

    nginx的修改 send_timeout 60; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeou ...

  4. [Asp.net]Uploadify上传大文件,Http error 404 解决方案 - wolfy

    引言 之前使用Uploadify做了一个上传图片并预览的功能,今天在项目中,要使用该插件上传大文件.之前弄过上传图片的demo,就使用该demo进行测试.可以查看我的这篇文章: [Asp.net]Up ...

  5. antd upload手动上传_SpringBoot 如何上传大文件?

    最近遇见一个需要上传超大大文件的需求,调研了七牛和腾讯云的切片分段上传功能,因此在此整理前端大文件上传相关功能的实现. 在某些业务中,大文件上传是一个比较重要的交互场景,如上传入库比较大的Excel表 ...

  6. SpringBoot如何上传大文件

    最近遇见一个需要上传超大大文件的需求,调研了七牛和腾讯云的切片分段上传功能,因此在此整理前端大文件上传相关功能的实现. 在某些业务中,大文件上传是一个比较重要的交互场景,如上传入库比较大的Excel表 ...

  7. AspUpload组件上传大文件

    最近闲来无事,给公司做了个内部娱乐网站(ASP的),用的服务器是win2003+IIS6.0,因为是内部的,足够用了.其中一个功能是在线影院,提供在线观看.下载功能,同时也提供上传功能. 在上传大文件 ...

  8. FTP上传大文件时连接重置或者中断,重新连接上传也出现同样情况处理办法

    上传大文件的时候经常连接被重置或者中断,重新连接上传出现同样错误,具体错误如下图所示: 原因:机房防火墙设置了tcp空闲5分钟中断,如果使用被动模式上传较大的文件,上传速度比较慢时容易造成超时,所以连 ...

  9. JavaScript上传大文件并支持中途取消上传

    最近遇见一个需要上传超大大文件的需求,调研了七牛和腾讯云的切片分段上传功能,因此在此整理前端大文件上传相关功能的实现. 在某些业务中,大文件上传是一个比较重要的交互场景,如上传入库比较大的Excel表 ...

最新文章

  1. 在EXCEL表格中怎么去掉全部的内容的最后一个字
  2. 【数据竞赛】一文看懂CCF BDCI 2020赛题任务与解析
  3. iOS经典面试题之使用runtime associate方法关联的对象释放及dealloc底层原理
  4. OpenShift 4 之使用https协议访问Route
  5. Freemarker判断对象是否为空的用法
  6. 实时流(直播流)播放、上墙(大屏播放)解决方案
  7. java编解码技术,netty nio
  8. python爬虫重定向问题_爬虫学习(1)
  9. 利用unlocker在VMware里解锁macOS操作系统
  10. StorageManager
  11. 使用Windows聚焦当壁纸
  12. UPnP和DLNA协议
  13. Android 实现图文混排
  14. 总结 拦截器(Interceptor) 和 过滤器(Filter)的区别
  15. 安全日志:/var/log/secure 详解
  16. 关于one-hot编码
  17. 我终于有了GMAIL帐号了
  18. 圆柱容器,横放计算液体体积
  19. 管窥《平凡的世界》写作特点之细节处理3500字
  20. 作品展之---广西联通彩信群发

热门文章

  1. UKF-MATLAB实现
  2. 机械手臂c语言如何编程,一种串联机械手臂的示教编程方法
  3. Arthas Spring Boot Starter工程启动报错
  4. 内大计算机学院研究生奖学金,计算机学院2020级硕士研究生学业奖学金评审结果公示...
  5. Docker常见使用
  6. python中有哪几种注释方式_python的注释有哪几种
  7. 【excel技巧读书笔记005】快速隔行填充
  8. 5寸android智能手机,5寸刚入门 六款巨屏安卓智能手机盘点(5)
  9. 博弈论_奇偶性、单向行走
  10. which must be escaped when used within the value