【发布时间】:2017-07-24 04:58:11
【问题描述】:
我尝试使用 this tutorial 部署一个带有 Nginx 和 Gunicorn 的 django 项目。我做了所有待办事项,但是,当我使用以下代码创建 /etc/nginx/sites-available/myproject 文件时:
server {
listen 80;
server_name server_domain_or_IP;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/sammy/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/sammy/myproject/myproject.sock;
}
}
然后运行sudo nginx -t 查找错误,我得到这个错误:
nginx: [emerg] open() "/etc/nginx/proxy_params" failed (2: No such file or directory) in /etc/nginx/sites-enabled/myproject:11
nginx: configuration file /etc/nginx/nginx.conf test failed
我该如何解决这个问题?
【问题讨论】:
标签: django nginx webserver gunicorn django-deployment