connect() failed (111: Connection refused)

 时间:2026-02-15 09:39:38

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

  • Linux移动文件
  • SecureCRT怎么解决中文乱码问题?
  • linux如何删除文件
  • cmd怎么杀死进程
  • ubuntu与centos的区别是什么
  • 热门搜索
    北京旅游地图全图 江苏苏州旅游景点大全 旅游网站设计模板 绵阳附近旅游景点 苏州旅游攻略三日游 上海到周庄旅游攻略 肇庆有什么旅游景点 旅游视频网 苏州三三旅游官网 土耳其旅游注意事项