【问题标题】:Uploading with curl with Apache proxy pass使用 Apache 代理通过 curl 上传
【发布时间】:2014-03-12 02:17:48
【问题描述】:

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

所以请求是这样的:

curl POST -> Apache (Proxy pass) -> 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.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

虚拟主机配置是:

<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>

【问题讨论】:

    标签: apache curl mod-proxy


    【解决方案1】:

    使用此参数--max-time 增加 curl 的执行时间,因为(可能)您正在上传一个大文件。例如 600 秒:

    --max-time 600
    

    如果问题没有解决,那么也尝试为你增加执行时间Import.do(可能在apache/http)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-09
      • 1970-01-01
      • 2011-04-09
      • 2010-11-21
      • 1970-01-01
      • 2014-08-30
      相关资源
      最近更新 更多