From 800adb3322f1267b57ff0dea2b0b9d35f99e053d Mon Sep 17 00:00:00 2001 From: whm <973418690@qq.com> Date: Wed, 15 Apr 2026 17:52:39 +0800 Subject: [PATCH] =?UTF-8?q?nginx:=20=E5=85=B3=E9=97=AD=20HTTPS=20=E7=9A=84?= =?UTF-8?q?=20HTTP/2=EF=BC=8C=E7=BC=93=E8=A7=A3=E5=A4=A7=E5=88=86=E7=89=87?= =?UTF-8?q?=20multipart=20=E6=96=AD=E8=BF=9E(status=200)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- nginx/yuheng.docker.conf.tpl | 2 +- nginx/yuheng.host.conf | 5 +++-- nginx/yuheng.yuxindazhineng.com.conf | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nginx/yuheng.docker.conf.tpl b/nginx/yuheng.docker.conf.tpl index 140c972..778cfbb 100644 --- a/nginx/yuheng.docker.conf.tpl +++ b/nginx/yuheng.docker.conf.tpl @@ -9,7 +9,7 @@ upstream yh_admin_upstream { server { listen 443 ssl; listen [::]:443 ssl; - http2 on; + # 不显式开启 http2(等同仅 HTTP/1.1),避免大分片 multipart 在 HTTP/2 下偶发断连 server_name yuheng.yuxindazhineng.com; client_max_body_size 800m; diff --git a/nginx/yuheng.host.conf b/nginx/yuheng.host.conf index 09c95d9..973fd19 100644 --- a/nginx/yuheng.host.conf +++ b/nginx/yuheng.host.conf @@ -19,8 +19,9 @@ upstream yh_admin_upstream { } server { - listen 443 ssl http2; - listen [::]:443 ssl http2; + # 关闭 http2:大体积分片 multipart 在部分浏览器+HTTP/2 组合下易出现 ERR_HTTP2_PROTOCOL_ERROR / 网络面板 status 0 + listen 443 ssl; + listen [::]:443 ssl; server_name yuheng.yuxindazhineng.com; client_max_body_size 800m; diff --git a/nginx/yuheng.yuxindazhineng.com.conf b/nginx/yuheng.yuxindazhineng.com.conf index 1670d00..5224496 100644 --- a/nginx/yuheng.yuxindazhineng.com.conf +++ b/nginx/yuheng.yuxindazhineng.com.conf @@ -13,8 +13,9 @@ server { # HTTPS:整站反代到 compose 内 Nginx(宿主机 443 → 127.0.0.1:8443) server { - listen 443 ssl http2; - listen [::]:443 ssl http2; + # 与 yuheng.host.conf 一致:大文件/分片上传在 HTTP/1.1 下更稳 + listen 443 ssl; + listen [::]:443 ssl; server_name yuheng.yuxindazhineng.com; ssl_certificate /etc/ssl/yh_web/yuheng.yuxindazhineng.com/fullchain.pem;