我正在使用 Django 在 Linux 服务器上开发 Web 应用程序。
在部署方面,一个建议的方式是使用Nginx与客户端通信,Django只需要与Nginx通信使用 uwsgi 协议(protocol)。
关系是client<-Http->Nginx<-uwsgi->Django server
后来我发现我也可以用
在公共(public)网络上推送服务器python manage.py runserver 0:0:0:0
Nginx 似乎可以帮助提供静态文件和媒体。
我的问题是,使用 Nginx 作为中间人到底有什么好处?
最佳答案
DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)
关于带和不带 Nginx 的 Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49293525/