uWSGI + nginx + Flask:无法访问网站

时间:2019-05-08 16:00:00

标签: nginx flask uwsgi

大约一个月前,我完成了我的AWS EC2 Ubuntu 18.04服务器的设置以运行Flask应用程序。从那时起,我一直在本地进行开发和测试。今天,我尝试启动我的应用程序,但无法连接到它。当我键入URL时,它只会显示“无法访问此网站X。花了太长时间无法回复”。

要进行设置,我几乎完全遵循this tutorial

有人可以帮助我诊断问题吗?我确定我可以键入一些命令来显示正在发生的事情,但是不幸的是我不知道它们。

这是我运行sudo systemctl restart nginxsudo systemctl restart registration后的.log文件的输出。

SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
worker 3 buried after 1 seconds
worker 4 buried after 1 seconds
worker 5 buried after 1 seconds
goodbye to uWSGI.
VACUUM: unix socket registration.sock removed.
*** Starting uWSGI 2.0.18 (64bit) on [Wed May  8 15:51:18 2019] ***
compiled with version: 7.3.0 on 21 March 2019 16:04:33
os: Linux-4.15.0-1035-aws #37-Ubuntu SMP Mon Mar 18 16:15:14 UTC 2019
nodename: ip-xxx-xx-xx-xx
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/ubuntu/registration
detected binary path: /home/ubuntu/registration/registration-venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 3841
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 registration.sock fd 3
Python version: 3.6.7 (default, Oct 22 2018, 11:32:17)  [GCC 8.2.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x55b917135450
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 437520 bytes (427 KB) for 5 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x55b917135450 pid: 1967 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1967)
spawned uWSGI worker 1 (pid: 1985, cores: 1)
spawned uWSGI worker 2 (pid: 1986, cores: 1)
spawned uWSGI worker 3 (pid: 1987, cores: 1)
spawned uWSGI worker 4 (pid: 1988, cores: 1)
spawned uWSGI worker 5 (pid: 1991, cores: 1)

sudo systemctl status nginx

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/nginx.service.d
           └─override.conf
   Active: active (running) since Wed 2019-05-08 15:51:14 UTC; 6min ago
     Docs: man:nginx(8)
  Process: 1938 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
  Process: 1959 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
  Process: 1953 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 1941 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 1957 (nginx)
    Tasks: 2 (limit: 1152)
   CGroup: /system.slice/nginx.service
           ├─1957 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─1960 nginx: worker process

May 08 15:51:14 ip-172-31-29-16 systemd[1]: Stopped A high performance web server and a reverse proxy server.
May 08 15:51:14 ip-172-31-29-16 systemd[1]: Starting A high performance web server and a reverse proxy server...
May 08 15:51:14 ip-172-31-29-16 systemd[1]: Started A high performance web server and a reverse proxy server.

sudo systemctl status registration

● registration.service - uWSGI instance to serve registration
   Loaded: loaded (/etc/systemd/system/registration.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-05-08 15:51:18 UTC; 6min ago
 Main PID: 1967 (uwsgi)
    Tasks: 6 (limit: 1152)
   CGroup: /system.slice/registration.service
           ├─1967 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1985 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1986 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1987 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           ├─1988 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini
           └─1991 /home/ubuntu/registration/registration-venv/bin/uwsgi --ini registration.ini

May 08 15:51:18 ip-172-31-29-16 systemd[1]: Stopped uWSGI instance to serve registration.
May 08 15:51:18 ip-172-31-29-16 systemd[1]: Started uWSGI instance to serve registration.
May 08 15:51:18 ip-172-31-29-16 uwsgi[1967]: [uWSGI] getting INI configuration from registration.ini

0 个答案:

没有答案