简体   繁体   English

如何修复数字海洋 django 应用程序上的“413 请求实体太大”

[英]How to fix a “413 request entity too large” on digital ocean-django app

I recently deployed a django app to digital ocean using gunicorn and nginx, the app is working but while trying to upload files, it threw an error我最近使用 gunicorn 和 nginx 将 django 应用程序部署到数字海洋,该应用程序正在运行,但在尝试上传文件时,它抛出了一个错误

413 request entity too large 413请求实体太大

I've tried some suggestions on this stackflow which state that there is need to add client_max_body_size to /etc/nginx/nginx.conf , when I did this, an error我已经在这个堆栈流上尝试了一些建议,其中指出需要将client_max_body_size添加到/etc/nginx/nginx.conf ,当我这样做时,出现错误

client_max_body_size directive not allowed in /etc/nginx/nginx.conf /etc/nginx/nginx.conf 中不允许使用 client_max_body_size 指令

was thrown.被抛出。 I really do not know what to do.我真的不知道该怎么办。

Check if client_max_body_size is properly declared as it may need additional configuration.检查 client_max_body_size 是否正确声明,因为它可能需要额外的配置。 Also, set the upload_max_filesize, post_max_size.另外,设置upload_max_filesize、post_max_size。 Check this article 检查这篇文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM