当我发布特定的SVGstring时,我在Apache + mod_wsgi中发生了一个奇怪的504错误。 后端应用程序是Python Flask,但它似乎并没有到达应用程序。
这是一个返回504错误的请求:
curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28style'
这是另一个以200返回的结果:
curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28styl'
不同之处在于我只从POST数据中删除了一个字符
SVG数据被裁减到可能产生错误的最小数据。 原始的SVGstring要大得多。
出现在apache错误日志中的错误是:
[Tue Jun 09 14:27:26 2015] [error] [client 10.5.226.115] (104)Connection reset by peer: mod_wsgi (pid=19254): Unable to get bucket brigade for request., referer: https://some.domain.com/ [Tue Jun 09 14:27:26 2015] [error] [client 10.5.226.115] mod_wsgi (pid=19252): Exception occurred processing WSGI script '/var/www/ade/src/interface.wsgi'. [Tue Jun 09 14:27:26 2015] [error] [client 10.5.226.115] IOError: failed to write data
我发出请求后,在错误日志中出现错误,在数据上传完成之前,
以下是我们的版本号:
Apache/2.2.22 (Ubuntu) mod_ssl/2.2.22 OpenSSL/1.0.1 mod_wsgi/3.3 Python/2.7.3
任何线索可能是什么原因造成的?
查看你的httpd.conf文件并增加超时值。
Timeout 600
保存该文件并重新启动Apache。