我正在尝试将我的 Web 应用程序发送到服务器,这是我第一次配置服务器。我按照本教程使用django-gunicorn-nginx设置http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/首先一切都很完美,我得到了django 欢迎页面。然后我在 django 项目中加载了应用程序并设置了静态根目录,现在我得到502 bad gateway你可以在http://qlimp.com中查看
gunicorn 和 supervisor 设置的所有内容都与该教程中所示的相同。但是我修改了一些nginx conf。这里是:
upstream app_server_djangoapp {
server localhost:8001 fail_timeout=0;
}
server {
listen 80;
server_name qlimp.com;
access_log /var/log/nginx/guni-access.log;
error_log /var/log/nginx/guni-error.log info;
keepalive_timeout 5;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server_djangoapp;
break;
}
}
location /files/ {
autoindex on;
root /home/nirmal/qlimp/qlimp/files/;
}
}
这是我的媒体网址:
MEDIA_URL = '/files/'
Files 是我拥有所有静态文件的文件夹。如何让我的项目在服务器中工作?有人可以指导我吗?
更新
错误日志 https://gist.github.com/2768425
谢谢!