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

发布于 2022-09-01 21:12:25 字数 1706 浏览 14 评论 0

执行

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/ 页面无法访问

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

递刀给你 2022-09-08 21:12:26

能访问就怪了 你的浏览器是说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

恬淡成诗 2022-09-08 21:12:26

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

sudo service nginx restart

然后再执行你那条命令

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文