nginx uwsgi配置成功运行后,浏览器无法访问,求大佬指点

uwsgi的配置文件 如下

[uwsgi]

socket=/tmp/uwsgi.sock

mount=/myapp=/home/nlp/pyfoot/IF/server.py

manage-script-name=true

master=true

processes=4

threads=2

stats=127.0.0.1:9191

callable=app

daemonize = /home/nlp/pyfoot/IF/server.log

nginx配置" title="nginx配置">nginx配置文件如下

server {

listen 8000;

server_name 172.22.11.46;

access_log /home/nlp/pyfoot/IF/access.log;

error_log /home/nlp/pyfoot/IF/error.log;

location /myapp {

root /myapp;

include uwsgi_params;

uwsgi_param /home/nlp/pyfoot/IF/myapp;

uwsgi_pass unix:/tmp/uwsgi.sock;

}

运行如下代码

[root@localhost ~]# /usr/local/nginx/sbin/nginx

[root@localhost ~]# uwsgi /home/nlp/pyfoot/IF/uwsgiconfig.ini

[uWSGI] getting INI configuration from /home/nlp/pyfoot/IF/uwsgiconfig.ini

[root@localhost ~]# uwsgi /home/nlp/pyfoot/IF/uwsgiconfig.ini

日志显示

*** Starting uWSGI 2.0.17 (64bit) on [Thu Jun  7 16:38:04 2018] ***

compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 07 June 2018 01:45:32

os: Linux-2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017

nodename: localhost.localdomain

machine: x86_64

clock source: unix

pcre jit disabled

detected number of CPU cores: 6

current working directory: /root

detected binary path: /usr/local/python/bin/uwsgi

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

your processes number limit is 47338

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 UNIX address /tmp/uwsgi.sock fd 3

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

Python version: 3.6.4 (default, Mar 13 2018, 11:21:39) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]

Python main interpreter initialized at 0x26c95d0

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

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 416880 bytes (407 KB) for 8 cores

*** Operational MODE: preforking+threaded ***

mounting /home/nlp/pyfoot/IF/server.py on /myapp

WSGI app 0 (mountpoint='/myapp') ready in 1 seconds on interpreter 0x26c95d0 pid: 14517 (default app)

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

*** uWSGI is running in multiple interpreter mode ***

spawned uWSGI master process (pid: 14517)

spawned uWSGI worker 1 (pid: 14519, cores: 2)

spawned uWSGI worker 2 (pid: 14520, cores: 2)

spawned uWSGI worker 3 (pid: 14521, cores: 2)

spawned uWSGI worker 4 (pid: 14523, cores: 2)

*** Stats server enabled on 127.0.0.1:9191 fd: 16 ***

但是在本机浏览器输入http://172.22.11.46/:8000/却无法访问,请问这是为何
图片描述

回答:

这个错误页面表示,请求根本没有到nginx。如楼上,看看服务器防火墙、8000端口开没开。

回答:

如果是 centos 的系统,记得关闭防火墙和 selinux。

回答:

你这个172.22.11.46是内网IP吧

以上是 nginx uwsgi配置成功运行后,浏览器无法访问,求大佬指点 的全部内容, 来源链接: utcz.com/a/162677.html

回到顶部