【发布时间】:2022-01-13 13:22:48
【问题描述】:
我有一个托管在 AKS 中的 Django / React 应用程序。 React 的构建由 Nginx 静态托管。 Nginx 容器通过 ClusterIP、Ingress 和 Nginx-Controller 公开。在这个应用程序中,我正在上传文件,但没有返回任何内容。不是错误,不是 HTTP 状态代码,什么都没有。这使得调试非常困难。这不会在本地发生,它只会发生在大于大约 10mb 的文件中。已经在nginx主机的default.conf中增加了client_max_body_size。在Controller docs 中找不到任何指示文件大小过大的内容,这也会导致 HTTP 413。有熟悉此问题的人吗?
在 React 中,我只是将 axios 与 formData 一起使用:
let formData = new FormData();
axios.post(`${API_SERVER}/builds`, formData).then(response => {
console.log(response);
}).catch(error => console.log(error));
HTTP 响应:
undefined undefined undefined
date: Wed, 08 Dec 2021 15:27:35 GMT
content-type: text/html
content-length: 176
strict-transport-security: max-age=15724800; includeSubDomains
X-Firefox-Spdy: h2
【问题讨论】:
标签: reactjs django nginx azure-aks