【发布时间】:2017-12-06 16:43:21
【问题描述】:
我的开发环境中的几个 docker 容器前面有一个 Traefik 反向代理。
我最近注意到通过端口 80 (Traefik) 提供大文件时会被截断。但是,如果我使用 Docker 容器上的本地 HTTP 端口下载文件,则该文件很好。
这似乎只影响超过一定大小的文件。
我像这样在我的一个 Docker 容器上生成了一个大文件。
for ((i=1;i<=200000;i++)); do echo "$i some new line that has a reasonably long length and content" >> public/large-file.txt; done
如果我 curl 文件并绕过 Traefik(此容器上的端口 4200),则文件是完整的并且每次都具有相同的确切大小。如果我通过 Traefik 在端口 80 上 curl 文件,则文件在看似随机的点被切断。
$ curl -O http://localhost/large-file.txt; cat large-file.txt
...
114633 some new line that has a reasonably long length and content
114634 some new line that has a reasonably long length and content
114635 some new line that has a rea
$ curl -O http://localhost/large-file.txt; cat large-file.txt
...
199732 some new line that has a reasonably long length and content
199733 some new line that has a reasonably long length and content
199734 some new line that has a re
基于这种行为,在我看来这不是 Docker 问题,也不是我的网络服务器的问题。相反,Traefik 似乎有错。
这是 Traefik 中的错误,还是潜在的错误配置?
【问题讨论】:
标签: docker reverse-proxy traefik