代理服务器收到来自上游服务器的无效响应

我有Tomcat服务器后面的Apache。 我正在使用mod_ssl和反向代理到tomcat。 所有运行在默认端口。

完整的错误如下。 确认代理错误

代理服务器收到来自上游服务器的无效响应。 代理服务器无法处理请求POST /pages/doeditpage.action。

原因:从远程服务器读取错误

如果我清理浏览器caching,错误消失并在几次尝试后返回。 我在Windows平台上的Chrome / Firefox / IE上进行testing。 想知道它在基于Linux的Chrome / Firefox上完美的工作。

我search了很多有堆栈溢出的答案,但我无法find我的答案。 这是一个服务器端的问题? 因为这么多的浏览器在Windows上不能同时出错。

在您的apacheconfiguration中尝试以下内容。 我包括了评论,因为这实际上是与debian的默认configuration。 并解释为什么使用这些选项:

# SSL Protocol Adjustments: # The safe and default but still SSL/TLS standard compliant shutdown # approach is that mod_ssl sends the close notify alert but doesn't wait for # the close notify alert from client. When you need a different shutdown # approach you can use one of the following variables: # o ssl-unclean-shutdown: # This forces an unclean shutdown when the connection is closed, ie no # SSL close notify alert is send or allowed to received. This violates # the SSL/TLS standard but is needed for some brain-dead browsers. Use # this when you receive I/O errors because of the standard approach where # mod_ssl sends the close notify alert. # o ssl-accurate-shutdown: # This forces an accurate shutdown when the connection is closed, ie a # SSL close notify alert is send and mod_ssl waits for the close notify # alert of the client. This is 100% SSL/TLS standard compliant, but in # practice often causes hanging connections with brain-dead browsers. Use # this only for browsers where you know that their SSL implementation # works correctly. # Notice: Most problems of broken clients are also related to the HTTP # keep-alive facility, so you usually additionally want to disable # keep-alive for those clients, too. Use variable "nokeepalive" for this. # Similarly, one has to force some clients to use HTTP/1.0 to workaround # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and # "force-response-1.0" for this. BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-6]" ssl-unclean-shutdown 

基本上closures保持活着的IE浏览器到版本6和declear ssl-unclean-shutdown直到当前(和未来)版本的IE浏览器。 如果仍然不适合您,请尝试以下操作

  BrowserMatch "MSIE [17-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive #BrowserMatch "MSIE [17-6]" ssl-unclean-shutdown 

回答我自己的问题。 基本上这样的问题可能会发生,如果有一些与Tomcat的Apache连接器的问题。

在我的情况下,我已经把超时值减less到5毫秒,我认为这对于任何基于互联网的应用来说都是非常小的。 而且,我在8443打开了一个新的连接器,可以和apache进行交stream。

就代理服务器和反向代理而言,您可以使用默认的不安全端口8080,并将安全和代理端口指定为443(apache安全端口)。

secure =“true”scheme =“https”proxyPort = 443在默认端口8080连接器中解决了这个问题。 我知道,对于任何一个有Java / Web背景的人来说,这可能是非常基本的东西,但对于像我这样对JAVA应用服务器没有任何了解的人来说,真是一件痛苦的事。