Apache + mod_wsgi vs nginx + gunicorn

前端 未结 4 1505
天涯浪人
天涯浪人 2021-01-31 17:04

I want to deploy a django site (it is the open source edx code on github).

I am faced with choosing between using

  1. Apache with mod_wsgi
  2. nginx with
4条回答
  •  执念已碎
    2021-01-31 17:25

    I have primarily worked with nginx and gunicorn. I am currently working with apache + mod_wsgi. It is actually easy if your Python version is 2.7 because mod_wsgi when installed directly from the package manager will work normally. But if your code is in a different Python version. mod_wsgi has to be built from source with the same version. If you installed your Python also from source then the procedure to get the whole web application working is fairly difficult.

    Nginx and gunicorn on the other hand do not have any version issues, since the proxypass param makes it easy to forward requests to gunicorn. All we need to ensure is that gunicorn is running with the same version of Python that your code is in.

提交回复
热议问题