AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1062581
Accepted
roy
roy
Asked: 2021-05-05 14:08:04 +0800 CST2021-05-05 14:08:04 +0800 CST 2021-05-05 14:08:04 +0800 CST

连接上游时 Nginx 上游超时(110:连接超时)

  • 772

我在容器(Kubernetes)中运行了 Nginx 和 App。使用 NginX 入口点进行 TLS 握手,配置如下

    upstream app {
        server app:8200;
    }

    server {
        listen                  443 ssl;
        server_name             localhost;
        ssl_certificate         /etc/ssl/util_example_com.crt;
        ssl_certificate_key     /etc/ssl/util_example_com.key;
        ssl_client_certificate  /etc/ssl/ca.crt;
        ssl_protocols           TLSv1.2 TLSv1.3;
        ssl_ciphers             HIGH:!aNULL:!MD5;
        ssl_verify_client       on;

        location / {
                proxy_pass         http://app;
                proxy_read_timeout 180;
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_http_version 1.1;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection 'upgrade';
                proxy_set_header   Host $host;
                proxy_cache_bypass $http_upgrade;
        }

    }

我可以curl http://app:8080/generator从 Nginx 容器。但是,当我在公共端点上使用 curl ( https://util.example.com/generator) 首先命中 Nginx 时,我504 Gateway Time-out在 Nginx 中得到 & 跟随错误

2021/05/04 21:54:50 [error] 21#21: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client: 10.2.16.183, server: localhost, request: "POST /generator HTTP/1.1", upstream: "http://172.20.154.113:8200/generator", host: "util.example.com"

任何帮助,这里发生了什么。

ssl nginx
  • 1 1 个回答
  • 5402 Views

1 个回答

  • Voted
  1. Best Answer
    Maanloper
    2021-05-05T14:58:20+08:002021-05-05T14:58:20+08:00

    尝试删除所有非必要部分。例如,尝试以下最小工作示例:(编辑 sub.domain.tld)

    upstream app {
            server app:8200;
        }
    
        server {
            listen                  443 ssl;
            server_name             sub.domain.tld;
            ssl_certificate         /etc/ssl/util_example_com.crt;
            ssl_certificate_key     /etc/ssl/util_example_com.key;
            location / {
                    proxy_pass         http://app;
            }
        }
    

    从那里添加元素,直到找到导致超时的原因。

    • 1

相关问题

  • 如何使用 Tomcat 5.5 更新 SSL 证书

  • 为 IIS6 自行生成 SSL 证书?

  • plesk 上的域和子域 ssl 访问

  • 如何设置 SSL 邮件服务器?

  • 如何通过 SVN 命令行接受 SSL 证书?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve