我们在 Java spring 框架上设置了一个 Web 门户。它运行在 tomcat 应用服务器上。Portal 是通过 apache 网络服务器通过 JK 连接器连接到 tomcat 的。整个门户都使用 Apache 的 443 端口启用了 HTTPS。Apache 版本是:Apache/2.4.2 (Unix)。它是 apache 网络服务器的最新稳定版本。
每当我们尝试将超过 128 KB 的文件上传到门户时,我们都会面临 413 错误:
Request Entity Too Large The requested resource /teamleadchoachingtracking/doFileUpload does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
Run Code Online (Sandbox Code Playgroud)
在 apache 错误日志中,我们收到以下错误:
AH02018: request body exceeds maximum size (131072) for SSL buffer
AH02257: could not buffer message body to allow SSL renegotiation to proceed
Run Code Online (Sandbox Code Playgroud)
我们在 google 上进行了搜索,有人建议将 SSLRenegBufferSize 设置为一些高值,例如 10MB。基于这些建议,我们将以下条目放入 httpd 配置文件的 virtualhost 部分:
<Directory "/teamleadchoachingtracking/doFileUpload/">
SSLRenegBufferSize 10486000
</Directory>
Run Code Online (Sandbox Code Playgroud)
但错误仍然存在。我们还指定了 SSLVerifyClient none,但仍在进行重新协商。
这是一个非常不一致和令人沮丧的错误。任何帮助将不胜感激。提前谢谢了。
web*_*tat 14
我设法通过在 apache httpd.conf 文件中放置某些配置来解决它。这是示例配置:
<Location "/calibration">
SSLRenegBufferSize 10486000
</Location>
Run Code Online (Sandbox Code Playgroud)
早些时候我没有给出正确的配置。关键是导致 http 413 错误的确切 URL 位置。在 location 指令中需要给出确切的 URL 位置。SSLRenegBufferSize 是参数,用于指定发生重新协商时的最大缓冲区大小(以字节为单位)。我已将其设置为 10 MB。Apache 默认为 128KB。