I
I
Ilya2015-12-24 20:11:56
Django
Ilya, 2015-12-24 20:11:56

What is the problem with nginx+uwsgi?

I'm trying to run a project on django, but I can't connect uwsgi with nginx, I get an error 502.
uwsgi config

[uwsgi]
project = devel0per.space
base = /home

chdir = %(base)/www/%(project)
home = %(base)/venv/space
module = %(project).wsgi:application

master = true
processes = 5

socket = %(base)/www/%(project)/%(project).sock
chmod-socket = 664
vacuum = true

uid = www-data
gid = www-data

nginx conf
server {
  listen 80;
  server_name devel0per.space;
  return 301 https://$server_name$request_uri;  
    rewrite ^(.*) https://devel0per.space$uri permanent;
}

server {
        listen 443 ssl;
    server_name devel0per.space;
    
    location /static/	{
  alias /home/www/devel0per.space/static;
    }
    
location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/home/www/devel0per.space/devel0per.space.sock;
    }
    
    ssl on;
    ssl_stapling on;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
    ssl_certificate     /etc/nginx/key/dev.crt;
    ssl_certificate_key /etc/nginx/key/dev.key;
    ssl_session_cache   shared:SSL:2m;
    ssl_session_timeout 24h;
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security "max-age=31536000;";
    add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report";
 
    access_log /home/log/devel0per-access.log;
    error_log /home/log/devel0per-error.log;
}

I try to run uwsgi uwsgi /home/www/devel0per.space/conf/uwsgi.ini
output
--- no python application found, check your startup logs for errors ---
[pid: 32331|app: -1|req: -1/1] 192.168.1.1 () {48 vars in 783 bytes} [Thu Dec 24 22:14:28 2015] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
--- no python application found, check your startup logs for errors ---
[pid: 32329|app: -1|req: -1/2] 192.168.1.1 () {50 vars in 761 bytes} [Thu Dec 24 22:14:28 2015] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Alyakimov, 2015-12-24
@kaiten

Nginx has nothing to do with it, you have a problem with launching the uswgi application, since the application does not start, nginx gives a 502 error

Z
zelsky, 2015-12-25
@zelsky

no python application found
It is clear that uwsgi cannot hide the application, see the paths.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question