阅读背景:

使用AWS ELB直接使用Gunicorn(没有nginx)有什么缺点?

来源:互联网 

Typical setups I've found on Google to run a django application on AWS all suggest a setup like

我在Google上发现的在AWS上运行django应用程序的典型设置都建议设置如下

ELB -> nginx -> gunicorn -> django

ELB - > nginx - > gunicorn - > django

I was wondering why the nginx part is really needed here? Isn't ELB sufficient as proxy?

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

In our case, we are running multiple Gunicorn/django instances in individual docker containers on ECS.

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

1 个解决方案

#1


5  

Without Nginx, It would work just fine and you will still be safe from the majority of DDOS attacks that can bring down an exposed gunicorn server.

如果没有Nginx,它可以正常工作,你仍然可以安全地免受可能导致暴露的gunicorn服务器崩溃的大多数DDOS攻击。

I can only see Nginx helpful to add to the stack if it'll be serving your static files. However, it's much better to serve your static files by S3 (+ cloudfront as a bonus) since it's has high availability and reliability baked in.

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

Sources: https://docs.gunicorn.org/en/latest/deploy.html#nginx-configuration https://stackoverflow.com/a/12801140

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


分享到: