- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
配置:
除了文件上传外,一切似乎都正常。由于某种原因,文件上传永远无法完成。使用下面列出的配置,我可以上传小文件 (4K)。上传 194K 文件失败。当我将“client_body_buffer_size”增加到 256K 时,我可以上传 194K 的文件,但是 500K 的文件上传失败。将“client_body_buffer_size”增加到超过 256K 没有影响。
注意:当我直接访问Tomcat并上传500K文件时,几毫秒就完成了。
所以,看起来 Nginx 配置有问题。非常感谢任何建议。
upstream tomcat_server {
server 127.0.0.1:9090 fail_timeout=0;
keepalive 16;
}
location / {
root /xyz;
proxy_http_version 1.1;
proxy_pass http://tomcat_server;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_connect_timeout 75;
proxy_send_timeout 180;
proxy_read_timeout 1200;
keepalive_timeout 120;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_path /tmp/nginx/proxy;
proxy_temp_file_write_size 1000m;
}
我尝试将其他几个参数添加到 nginx 配置(client_body_temp_path、proxy_temp_path、proxy_temp_file_write_size)。他们似乎没有帮助。
====
更新 - 2013/07/30:
进一步调查显示我们在上传 196K 及以上的文件时遇到问题。 194K 文件有效。 “client_body_buffer_size”值设置为 256K。
如果出现故障,Nginx 调试日志会显示以下内容:
2013/07/30 16:29:57 [debug] 14208#0: *1 recv: fd:11 2606 of 16384
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy status 200 "200 OK"
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy header: "Server: Apache-Coyote/1.1"
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy header: "Content-Type: text/html;charset=utf-8"
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy header: "Date: Tue, 30 Jul 2013 22:29:57 GMT"
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy header: "Connection: close"
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy header done
2013/07/30 16:29:57 [debug] 14208#0: *1 xslt filter header
2013/07/30 16:29:57 [debug] 14208#0: *1 HTTP/1.1 200 OK^M
Server: nginx/1.5.2^M
Date: Tue, 30 Jul 2013 22:29:57 GMT^M
Content-Type: text/html;charset=utf-8^M
Transfer-Encoding: chunked^M
Connection: keep-alive^M
2013/07/30 16:29:57 [debug] 14208#0: *1 write new buf t:1 f:0 000000001E61DAD8, pos 000000001E61DAD8, size: 168 file: 0, size: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 http write filter: l:0 f:0 s:168
2013/07/30 16:29:57 [debug] 14208#0: *1 http cacheable: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 posix_memalign: 000000001E62D450:4096 @16
2013/07/30 16:29:57 [debug] 14208#0: *1 http proxy filter init s:200 h:0 c:0 l:-1
2013/07/30 16:29:57 [debug] 14208#0: *1 http upstream process upstream
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe read upstream: 1
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe preread: 2465
2013/07/30 16:29:57 [debug] 14208#0: *1 readv: 1:13778
2013/07/30 16:29:57 [debug] 14208#0: *1 readv() not ready (11: Resource temporarily unavailable)
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe recv chain: -2
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe buf free s:0 t:1 f:0 000000001E61DBD0, pos 000000001E61DC5D, size: 2465 file: 0, size: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe length: -1
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe write downstream: 1
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe write busy: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe write: out:0000000000000000, f:0
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe read upstream: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe buf free s:0 t:1 f:0 000000001E61DBD0, pos 000000001E61DC5D, size: 2465 file: 0, size: 0
2013/07/30 16:29:57 [debug] 14208#0: *1 pipe length: -1
2013/07/30 16:29:57 [debug] 14208#0: *1 event timer add: 11: 180000:1375223577332
2013/07/30 16:29:57 [debug] 14208#0: *1 http upstream request: "/upload/html?"
2013/07/30 16:29:57 [debug] 14208#0: *1 http upstream send request handler
2013/07/30 16:29:57 [debug] 14208#0: timer delta: 6
2013/07/30 16:29:57 [debug] 14208#0: posted events 0000000000000000
2013/07/30 16:29:57 [debug] 14208#0: worker cycle
2013/07/30 16:29:57 [debug] 14208#0: epoll timer: 179994
我在上面的日志片段中注意到“http upstream send request handler”,在成功案例中,我看到了这个:
2013/07/30 16:29:44 [debug] 14208#0: *1 http upstream dummy handler
知道“http upstream send request handler”和“http upstream dummy handler”是什么意思,它们代表什么?
最佳答案
我遇到了同样的问题。 Michael Härtl 的回答是正确的。在我的例子中,这是成功的设置:
在 nginx.conf 添加:
http {
# at the END of this segment!
client_max_body_size 1000m;
}
关于file - 不能用Nginx(反向代理+SSL协商)和Tomcat上传大文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17932569/
问题 调用 InitializeSecurityContext 时,我应将什么值传递给TargetName参数? 修改后的背景 我正在调用 InitializeSecurityContext 函数:
尝试让信号器启动并运行。我不断从服务器返回 2 个错误: GET negotiate url 返回 500 内部服务器错误 XMLHttpRequest 无法加载 http://localhost:1
我使用的是 Windows XP Pro SP3。我想在我的代码中使用 SSPI 函数。我编译了我的代码,没有错误。 我将安全包设置为用于协商,这是推荐的。 当我启动我的程序时,Negotiate 无
我正在尝试使用 C++ 和 QT 作为 GUI 来实现 Telnet 客户端。我不知道如何处理 telnet 协商。每个 telnet 命令都以 IAC 开头,例如 IAC WILL SUPPRESS
我正在使用 SignalR 2.0。在我的 VS 2012 上本地运行时一切正常。但是当我在 IIS 上发布站点时,它会中断。该站点已加载,但其中一个脚本返回 404 Not Found。脚本有点像。
我在 MS Azure 上配置了一个实例,并为域实现了 SSL 证书。当我测试性能(在 3G 上)时,我注意到 SSL 协商同时发生在两个请求上,这(不必要地)延长了过程并导致 0.6 秒的时间完成。
我有以下问题。 操作系统:CentOS 6.6 PHP:5.5 Curl: 7.43 编译 当我执行“curl -V”时,我得到以下信息: curl 7.43.0 (x86_64-unknown-li
有一个私有(private)网络服务器(支持 https),我需要经常在上面读取/设置一些信息。我做了一些java代码来自动完成。当我使用 Chrome 访问它时,第一次连接很慢(可能 5 秒),但持
我使用的是 IIS7,我们所有的文件都是通过 HTTPS 提供的。在查看瀑布 View (WebPageTest) 时,我注意到对每个文件进行 SSL 协商需要一些时间。有没有一种方法可以配置服务器或
我有一个简单的 SMTP 客户端,我正在尝试向其添加 TLS 支持。我不确定客户端发出“STARTTLS”命令后会发生什么。大多数来源(包括 RFC 本身)将其描述为 TLS session 的协商,
我一直在尝试在 IIS 托管的网站中使用 service worker 来缓存站点的一些静态内容。该站点是使用 Windows 身份验证的内部应用程序。我已经能够在没有太多麻烦的情况下注册和运行 se
我开始修补 Azure SignalR,并遇到了协商触发器问题。我关注了this微软官方指南: 这是我的代码: 本地.settings.json { "IsEncrypted": false,
Index.cshtml @{ ViewBag.Title = "Index"; } $(function () { var connection = $.connection('
Index.cshtml @{ ViewBag.Title = "Index"; } $(function () { var connection = $.connection('
我正在使用 openssl 正常连接到 SMTP 服务器(未加密),发送 STARTTLS 命令,协商 SSL 加密,然后与加密 session 交互。 这是我正在使用的命令(通过 telnet):
我正在为 iOS 进行 unix 服务器 ssh 模拟。在谈判过程中,我遇到了很多障碍,并且仍在与这些障碍作斗争。最新的一个是关于 SSH2_MSG_KEX_DH_GEX_REPLY 数据包数据,我在
我们有两个连接(作为 .NET/Windows 客户端)到 IBM MQ 端点(假设是非 Windows)。 我们使用 SSL,它由一对证书(客户端和服务器)支持并在 Windows 证书存储中正确标
我读到 ejabberd 建议使用 STARTTLS 协商来实现通信实体之间的安全连接。当我安装 ejabberd 时,默认情况下它带有 TLS 证书。 那为什么要买证书安装呢?既然我们有默认证书,从
您好,我正在尝试使用 JAVA 和 spring 设置 SSO。为此,我正在使用此文档:http://docs.spring.io/spring-security-kerberos/docs/1.0.
从阅读 Microsoft docs在使用 SignalR 进行身份验证时,使用不记名 token 进行身份验证的唯一方法似乎是将其发送到 WebSocket 连接上的查询字符串中。 在检查 Sign
我是一名优秀的程序员,十分优秀!