簡體   English   中英

Nginx 代理管理器 502 Bad Gateway 錯誤僅在 https 模式下

[英]Nginx Proxy Manager 502 Bad Gateway error only on https mode

我的 Nginx 代理管理器和 HTTPS 有問題。 我的 Nginx 代理管理器在 docker 上運行。 並且我的 PiHole 使用自定義 dns 記錄將我的域(sub.domain.de)重定向回我的服務器(在端口 80),其中 Nginx 代理管理器正在運行。 代理管理器配置為使用我想要連接到的 docker 容器的端口(例如 192.168.178.35:6595)。

我收到此錯誤:

2022/01/09 11:43:57 [error] 1636#1636: *21857 SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) while SSL handshaking to upstream, client: 172.17.0.1, server: sub.domain.de, request: "GET / HTTP/2.0", upstream: "https://192.168.178.35:6595/", host: "sub.domain.de"

我的域有一個有效的 Let's Encrypt 證書,它也可以工作,但前提是我將代理管理器設置為 http 並強制 ssl。 但如果我說 https,它會給我錯誤“502 Bad Gateway”。 對於 Https,我的意思是: Nginx 代理管理器配置圖

這是此域示例的 Nginx 代理管理器配置。

# ------------------------------------------------------------
# sub.domain.de
# ------------------------------------------------------------

server {
  set $forward_scheme https;
  set $server         "192.168.178.35";
  set $port           6595;

  listen 80;
listen [::]:80;

listen 443 ssl http2;
listen [::]:443 ssl http2;

  server_name sub.domain.de;

  # Let's Encrypt SSL
  include conf.d/include/letsencrypt-acme-challenge.conf;
  include conf.d/include/ssl-ciphers.conf;
  ssl_certificate /etc/letsencrypt/live/npm-10/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/npm-10/privkey.pem;


  access_log /data/logs/proxy-host-19_access.log proxy;
  error_log /data/logs/proxy-host-19_error.log warn;

  location / {

    # Proxy!
    include conf.d/include/proxy.conf;
  }

  # Custom
  include /data/nginx/custom/server_proxy[.]conf;
}

要將 HTTPS 與 Nginx 代理管理器一起使用,您只需 select ZEA52C244標簽中的證書。 您已設置為 https 的詳細信息選項卡中的方案選項必須為 http,因為您轉發到 (192.168.178.35:6595) 的主機沒有 ZEA52C2244.D5 證書證書僅在代理上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM