文件上传遇到诡异问题,lighttpd不能正确转发,返回一个http 301,Robbin好像提到过

应用场景:

上传图片(post /photos),走不到rails的create action。用webrick正常。


观察lighttpd日志,转发给rails的dispatch.fcgi,返回的基本是302(临时重定向),这些post都没有问题。

但上传图片时,返回302,0字节。浏览器拿了302就自动的、错误的去get /photos。

记得Robbin提到过rails在fcgi方式下文件上下载的一个bug,还说是一个可耻的bug,一直不修复。


环境:linux

lighttp日志:

12142 121.35.75.46 baicaonet.com - [22/Feb/2009:17:30:19 +0800] "POST /photos HTTP/1.1" 301 0 "http://baicaonet.com/photos/new?id=1&type=Album" "Mozilla/4.0 (compa        tible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1)"


forefix自动去get,非正常业务逻辑
12143 121.35.75.46 baicaonet.com - [22/Feb/2009:17:30:19 +0800] "GET /photos/ HTTP/1.1" 404 607 "http://baicaonet.com/photos/new?id=1&type=Album" "Mozilla/4.0 (com        patible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1)"

12144 121.35.75.46 baicaonet.com - [22/Feb/2009:17:33:33 +0800] "GET /photos/new?id=1&type=Album HTTP/1.1" 304 0 "http://baicaonet.com/albums/1" "Mozilla/4.0 (comp        atible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1)"

webrick则正常

121.35.75.46 - - [22/Feb/2009:16:59:55 CST] "POST /photos HTTP/1.1" 302 100
http://baicaonet.com:3000/photos/new?id=1&type=Album -> /photos

正常业务逻辑,成功后看查看
121.35.75.46 - - [22/Feb/2009:16:59:59 CST] "GET /photos/4 HTTP/1.1" 200 6834
http://baicaonet.com:3000/photos/new?id=1&type=Album -> /photos/4
121.35.75.46 - - [22/Feb/2009:17:00:00 CST] "GET /images/new/share.gif HTTP/1.1" 200 137

你可能感兴趣的:(windows,linux,socket,lighttpd,Rails)