все сделал как нужно, вот что имею.
^C(okt)root@crackkc:/var/www/oktyabr/oktyabr/mysite# uwsgi --http :8080 --wsgi-file test.py
*** Starting uWSGI 2.0.11.1 (32bit) on [Thu Aug 13 01:24:39 2015] ***
compiled with version: 4.7.2 on 10 August 2015 07:29:03
os: Linux-2.6.32-042stab108.2 #1 SMP Tue May 12 18:07:50 MSK 2015
nodename: crackkc
machine: i686
clock source: unix
detected number of CPU cores: 1
current working directory: /var/www/oktyabr/oktyabr/mysite
detected binary path: /var/www/oktyabr/okt/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 513280
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8080 fd 4
spawned uWSGI http 1 (pid: 3970)
uwsgi socket 0 bound to TCP address 127.0.0.1:42326 (port auto-assigned) fd 3
Python version: 2.7.3 (default, Mar 14 2014, 12:14:27) [GCC 4.7.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x9f02c58
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 63988 bytes (62 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x9f02c58 pid: 3969 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 3969, cores: 1)
в браузере получаю Hello World
теперь дальше если пытаюсь запустить через nginx
^C(okt)root@crackkc:/var/www/oktyabr/oktyabr/mysite# uwsgi --socket :8001 --wsgi-file test.py --thunder-lock --enable-threads
*** Starting uWSGI 2.0.11.1 (32bit) on [Thu Aug 13 01:26:44 2015] ***
compiled with version: 4.7.2 on 10 August 2015 07:29:03
os: Linux-2.6.32-042stab108.2 #1 SMP Tue May 12 18:07:50 MSK 2015
nodename: crackkc
machine: i686
clock source: unix
detected number of CPU cores: 1
current working directory: /var/www/oktyabr/oktyabr/mysite
detected binary path: /var/www/oktyabr/okt/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 513280
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address :8001 fd 3
Python version: 2.7.3 (default, Mar 14 2014, 12:14:27) [GCC 4.7.2]
Python main interpreter initialized at 0x8fdc810
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 63988 bytes (62 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x8fdc810 pid: 3981 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 3981, cores: 1)
то получаю в браузере 502 Bad Gateway
вот скрипт для nginx
# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream django {
# server unix:///var/www/oktyabr/oktyabr/mysite/mysite.sock; # for a file socket
server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name niws.ru; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /var/www/oktyabr/oktyabr/media; # your Django project's media files - amend as required
}
location /static {
alias /var/www/oktyabr/oktyabr/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /var/www/oktyabr/oktyabr/uwsgi_params; # the uwsgi_params file you installed
}
}
~
до этого запустил щас не могу не пойму разобраться, как я понял nginx слушает сокеты и переправляет их на вывод в браузер, а uwsgi создает такой сокет с портом 8001.