使用Apache代理传递curl上传

时间:2014-02-13 09:36:57

标签: apache curl mod-proxy

我有一个场景,外部客户端通过curl将zip文件上传到我的应用程序。该应用程序位于Apache背后的jboss服务器上,代理通过。

所以请求是这样的:

卷曲POST - > Apache(代理通行证) - > Jboss(一些servlet listneing)

上传不会发生它看起来在Apache中停止我在apache错误日志中收到错误。

(70007)The timeout specified has expired: proxy: error reading status line from remote server 10.31.1.52
proxy: Error reading from remote server returned by /Import.do

curl上传看起来像这样:

curl.exe --insecure -o IMPORT_RESP.XML -F file=@d:\temp\file_to_upload\1392209753981_pb4Mp.zip -F un=username  -F pw=password https://my.url.com/Import.do

vhost配置为:

<VirtualHost 10.31.127.254:443>

SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW

SSLCertificateFile /etc/pki/tls/certs/4pm.si_wildcard.crt
SSLCertificateKeyFile /etc/pki/tls/private/4pm.si_wildcard.key
SSLCACertificateFile /etc/pki/tls/certs/ca_cert_bundle.crt

AddDefaultCharset utf-8

SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0

#ProxyPreserveHost On
ProxyPass / http://10.31.1.52:8080/ retry=0
ProxyPassReverse / http://10.31.1.52:8080/

ServerName my.url.com

LogLevel debug  
ErrorLog /var/log/httpd/4pm/my.url.com-error.log
CustomLog /var/log/httpd/4pm/my.url.com-access.log combined

</VirtualHost>

1 个答案:

答案 0 :(得分:0)

使用此参数--max-time(可能)正在上传大文件,从而增加卷曲的执行时间。例如600秒:

--max-time 600

如果问题无法解决,那么也会尝试增加Import.do的执行时间(可能是apache / http)