首页 > uwsgi --socket :8000 --wsgi-file test.py 无法访问?

uwsgi --socket :8000 --wsgi-file test.py 无法访问?

执行

uwsgi --socket :8000 --wsgi-file test.py

提示如下:

*** Starting uWSGI 2.0.11.2 (64bit) on [Tue Nov 17 21:50:32 2015] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-16) on 17 November 2015 16:28:51
os: Linux-2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013
nodename: localhost.localdomain
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /var/pysite/scm
detected binary path: /var/python3/bin/uwsgi
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 61475
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 socket 0 bound to TCP address :8000 fd 3
Python version: 3.4.3 (default, Nov 17 2015, 13:24:57)  [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x9fb030
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x9fb030 pid: 28462 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 28462, cores: 1)

访问 http://ip地址:8000/ 页面无法访问


能访问就怪了 你的浏览器是说http的而不是直接说uwsgi的,

最简单的方法,让uwsgi直接说http

uwsgi --http :8000 --wsgi-file test.py

或者,在部署中,让nginx说uwsgi(nginx原生支持:http://nginx.org/en/docs/http/ngx_http_uwsgi_module.html),在用浏览器和nginx说http


我也遇到了这个问题,
如果你是按照http://uwsgi-docs.readthedocs...这个教程来的。
那么记得重启下nginx

sudo service nginx restart

然后再执行你那条命令

【热门文章】
【热门文章】