django - 直接将 AWS ELB 与 Gunicorn(无 nginx)一起使用有哪些缺点?

标签 django amazon-web-services reverse-proxy gunicorn amazon-elb

我在谷歌上找到的在 AWS 上运行 django 应用程序的典型设置都建议像这样的设置

ELB -> nginx -> gunicorn -> django

我想知道为什么这里真的需要 nginx 部分? ELB 不足以作为代理吗?

在我们的例子中,我们在 ECS 上的各个 docker 容器中运行多个 Gunicorn/django 实例。

最佳答案

如果没有 Nginx,它会工作得很好,而且您仍然可以免受大多数 DDOS 攻击,这些攻击会导致暴露的 gunicorn 服务器瘫痪。

我只能看到 Nginx 有助于将其添加到堆栈中,前提是它可以为您的静态文件提供服务。但是,最好通过 S3(+ cloudfront 作为奖励)为您的静态文件提供服务,因为它具有高可用性和可靠性。

资料来源:
http://docs.gunicorn.org/en/latest/deploy.html#nginx-configuration
https://stackoverflow.com/a/12801140

关于django - 直接将 AWS ELB 与 Gunicorn(无 nginx)一起使用有哪些缺点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46248179/

相关文章:

amazon-web-services - 在 Lambda 函数中关闭 DAX 客户端

nginx 反向代理到在 localhost 上运行的后端

apache - 如何在 Apache 中正确配置 VirtualHost(用于 eXist-db 应用程序)

security - 为 Apache 配置 mod_proxy 以拒绝错误的域请求

Django 管理员根据表单字段值在更改表单中添加自定义按钮

django - 确定输入的日期范围是否与现有日期范围重叠

python - 想使用 PubNub 将实时更新发送到用户的网络浏览器

python - 运行时警告: You're running the worker with superuser privileges: this is absolutely not recommended

ruby-on-rails - 每当 gem on aws opsworks

apache - 从 XAMPP 的 apache 连接到 Elasticache 的 Redis