connect() failed (111: Connection refused)

2025-10-17 11:21:51

1、出现此错误提示,表明uwsgi.ini或nginx.conf有问题,导致nginx 访问uwsgi被拒绝

2、解决方法:

1、检查uwsgi.ini

[uwsgi]

socket = 127.0.0.1:8077

chdir = /root/env/demo

wsgi-file = demo/wsgi.py

processes = 2

threads = 4

chmod-socket = 664

vacuum = true

2、检查nginx.conf

server {

        listen       80 default_server;

        listen       [::]:80 default_server;

        server_name localhost;

        charset     utf-8;

        # Load configuration files for the default server block.

       # include /etc/nginx/default.d/*.conf;

        location / {

                  root         /root/env/demo;

                  include     /etc/nginx/uwsgi_params;

                  uwsgi_pass   127.0.0.1:8077;

        }

        location /static {

                alias /root/env/ht/collected_static;

     }

        location /media {

                alias /root/env/ht/media;

     }

}

3、如果上述还不能解决问题,查看SELinux状态:

#getenforce

用于解决:failed (13: Permission denied) whileconnecting to upstream

如果SELinux status参数为enabled即为开启状态

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:113
  • 阅读量:117
  • 阅读量:168
  • 阅读量:166
  • 阅读量:181
  • 猜你喜欢