nginx 502错误-连接到上游时connect()失败(111:连接被拒绝)

时间:2019-09-14 18:02:37

标签: nginx flask cloudflare

尝试使用https访问我的域时出现502网关错误。

我正在使用...

  • Flask部署一个Webhook接收器(flask应用正在监听127.0.0.1:3000)。
  • NGINX,以便创建反向代理系统(使用代理通过)。
  • 使用Cloudflare来创建TLS证书(nginx为https)。

这是我的文件...

  • error.log
Index
  • nginx.conf
    2019/09/14 09:39:12 [error] 11617#11617: *1068 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.123.167, server: whatisbrazil.club, request: "GET / HTTP/1.1", upstream: "https://127.0.0.1:3000/", host: "whatisbrazil.club"
    2019/09/14 16:36:58 [warn] 13605#13605: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/pyapp.conf:5

  • pyapp.conf(nginx.conf中包含的文件)
    user  nginx;
    worker_processes  1;

    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;


    events {
        worker_connections  1024;
    }


    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;

        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';

        access_log  /var/log/nginx/access.log  main;

        sendfile        on;
        #tcp_nopush     on;

        keepalive_timeout  65;

        #gzip  on;

        upstream mysite {
           server 127.0.0.1:3000;
           keepalive 32;
        } 

        include /etc/nginx/conf.d/*.conf;
    }

在这种情况下会出现什么错误?是在配置中还是我设置烧瓶应用程序的方式?

0 个答案:

没有答案