鍍金池/ 問(wèn)答/Python  Linux/ nginx uwsgi配置成功運(yùn)行后,瀏覽器無(wú)法訪問(wèn),求大佬指點(diǎn)

nginx uwsgi配置成功運(yùn)行后,瀏覽器無(wú)法訪問(wèn),求大佬指點(diǎn)

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配置文件如下

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;   

        }

運(yùn)行如下代碼

[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 ***

但是在本機(jī)瀏覽器輸入http://172.22.11.46:8000/卻無(wú)法訪問(wèn),請(qǐng)問(wèn)這是為何
圖片描述

回答
編輯回答
撥弦

你這個(gè)172.22.11.46是內(nèi)網(wǎng)IP吧

2017年12月13日 15:49
編輯回答
茍活

如果是 centos 的系統(tǒng),記得關(guān)閉防火墻和 selinux。

2017年1月18日 11:57
編輯回答
怪痞

這個(gè)錯(cuò)誤頁(yè)面表示,請(qǐng)求根本沒(méi)有到nginx。如樓上,看看服務(wù)器防火墻、8000端口開(kāi)沒(méi)開(kāi)。

2017年10月29日 13:10