Nginx和gunicorn正在运行,但我得到502 Bad Gateway nginx / 1.4.6(Ubuntu)错误

时间:2016-04-16 07:22:37

标签: python django ubuntu nginx gunicorn

我按照数字海洋指示部署了我的django应用程序。 gunicorn和nginx正在运行但是当我的网关错误时。

这是我的nginx conf:

server {
    listen 80;
    server_name 192.69.216.111;

    root /Owia/;
    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /Owia;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/admin/Owia/Owia.sock;
    }


     location /static/admin {
     root /Owia/venv/lib/python3.4/site-packages/django/contrib/admin/;

    }

     location ~* \.(css|js|gif|jpe?g|png)$ {
     expires 365d;
     add_header Pragma public;
     add_header Cache-Control "public, must-revalidate, proxy-revalidate";
     }
 }

这是我的枪声:

description "Gunicorn application server handling Owia"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid www-data
setgid www-data

chdir /Owia



exec venv/bin/gunicorn --workers 3 --bind unix:/home/admin//Owia.sock Owia.wsgi:application

我应该去别的地方查一下吗?什么可能是错的?

0 个答案:

没有答案