养生 装修 购物 美食 感冒 便秘 营销 加盟 小吃 火锅 管理 创业 搭配 减肥 培训 旅游

connect() failed (111: Connection refused)

时间:2024-10-21 03:13:26

nginx+uwsgi+django,nginx日志报错:connect()failed(111:Connectionrefused)whileconnectingtoupstream

方法/步骤

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

2、解决方法:检查uwsgi.ini[u嘛术铹砾wsgi]socket=127.0.0.1:8077chdir=/root/env/demows爿讥旌护gi-file=demo/wsgi.pyprocesses=2threads=4chmod-socket=664vacuum=true检查nginx.confserver{listen80default_server;listen[::]:80default_server;server_namelocalhost;charsetutf-8;#Loadconfigurationfilesforthedefaultserverblock.#include/etc/nginx/default.d/*.conf;location/{root/root/env/demo;include/etc/nginx/uwsgi_params;uwsgi_pass127.0.0.1:8077;}location/static{alias/root/env/ht/collected_static;}location/media{alias/root/env/ht/media;}}

3、如果上述还不能解决问题,查看SELinux状态:#getenforce用于解决:failed(13:Permissiondenied)whileconnectingtoupstream如果SELinuxstatus参数为enabled即为开启状态修改/etc/selinux/config文件将SELINUX=enforcing改为SELINUX=disabled

© 一点知识