2014-02-10 54 views
1

我使用lighttpd作为当前版本2.1.1上的一组Play实例的反向代理。 Play应用程序使用分块传输编码来执行COMet(服务器推送)。 Lighttpd版本是1.4.28(Ubuntu 12.04的最新支持版本)。Lighttpd反向代理将HTTP/1.1请求转换为1.0

此设置运行良好,但现在我升级到Play Framework 2.2.1。该框架现在强制分块响应必须响应HTTP/1.0请求(请参阅https://github.com/playframework/playframework/commit/5131c46626b82f966a9b7894cf9bfcdc1b464f3e),结果证明我的lighttpd代理正在将HTTP/1.1请求转换为HTTP/1.0。 Play的确切响应是505,并带有消息“The response to this request is chunked and hence requires HTTP 1.1 to be sent, but this is a HTTP 1.0 request.”。

那么下一步呢?我不知道我的替代方案(获取最新版本的lighttpd,切换到nginx)很可能会起作用。

更新:lighttpd看起来不太有希望,因为mod_proxy.c具有HTTP/1.0硬编码,即使它处理分块编码。

回答

5

我解决了这个问题,用Nginx替换Lighttpd作为我的反向代理。下面是精确的Nginx配置节,它将在server部分内:

location/{ 
    proxy_http_version 1.1;  
    proxy_pass http://127.0.0.1:8080; 
}