【发布时间】:2013-12-05 06:56:25
【问题描述】:
我是 nginx 和 gunicorn 的新手。
我已经安装并配置了 nginx。 如何将其指向 gunicorn? 如何检查 nginx 和 gunicorn 是否正确配置和工作?
请告诉我。
谢谢。
【问题讨论】:
我是 nginx 和 gunicorn 的新手。
我已经安装并配置了 nginx。 如何将其指向 gunicorn? 如何检查 nginx 和 gunicorn 是否正确配置和工作?
请告诉我。
谢谢。
【问题讨论】:
您可以在这里查看我对如何配置 nginx.conf 的类似问题的回答:Django Gunicorn not load static files
它基本上得到了 Gunicorn 的服务:proxy_pass http://127.0.0.1:8000;
关于 Gunicorn,只需使用:sudo unicorn name_of_your_app.wsgi:application 启动它。如果您没有收到任何错误消息,那么您就可以了。如果它给你一个错误消息并且 Gunicorn 停止了,那么你就有问题了。
记得启动nginx!如果它已经在运行并且您更改了 nginx.conf,您必须使用以下命令重新启动它:sudo nginx -s reload
祝你好运!
【讨论】: