我有一台运行 proxmox 的服务器,上面有 3 个虚拟机:NGINX、Bitwarden 和 Nextcloud。Bitwarden 运行良好,这证明 NGINX 运行正常,但是当 NGINX 尝试连接到 Nextcloud 时,会出现 502 错误。这些虚拟机都配置了网桥,并且都可以由 NGINX 访问。
理想情况下,我希望 NGINX 能够处理 SSL。
我正在使用 Nextcloud AIO docker 镜像,AIO 接口运行良好,只有通过 NGINX 代理的流量会导致 502。
以下是我的 NGINX 配置的相关部分:
server {
listen 443 ssl;
server_name nextcloud.verumignis.com;
ssl_certificate /etc/letsencrypt/live/verumignis.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/verumignis.com/privkey.pem;
location /.well-known/acme-challenge/ {
alias /usr/share/nginx/html/.well-known/acme-challenge/;
try_files $uri =404;
}
location / {
proxy_pass https://192.168.2.48:443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name nextcloud.verumignis.com;
location /.well-known/acme-challenge/ {
alias /usr/share/nginx/html/.well-known/acme-challenge/;
try_files $uri =404;
}
location / {
proxy_pass http://192.168.2.48:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
以下是 NGINX 错误日志中的错误:
2023/10/02 00:18:53 [error] 2381#2381: *573 SSL_do_handshake() failed (SSL: error:0A000438:SSL routines::tlsv1 alert internal error:SSL alert number 80) while SSL handshaking to upstream, client: 192.168.1.69, server: nextcloud.verumignis.com, request: "GET / HTTP/2.0", upstream: "https://192.168.2.48:443/", host: "nextcloud.verumignis.com", referrer: "https://192.168.2.48:8080/"
当端口 80 和 443 直接转发到 Nextcloud 时,它可以正常工作,但显然这会破坏其他服务的运行。
非常感谢您的帮助,提前谢谢。