From c69f11e1c96fb67e179ca9ebc48e36ef448e83ff Mon Sep 17 00:00:00 2001 From: jade Date: Fri, 24 Jul 2026 17:42:25 +0900 Subject: [PATCH] fix: add http2 support to Nginx to match Apache h2c proxying --- nginx/blue.conf | 80 ++++++++++++++++++++++++++++++++++++++++++++++-- nginx/green.conf | 80 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 154 insertions(+), 6 deletions(-) diff --git a/nginx/blue.conf b/nginx/blue.conf index 8dbbf021..a169be5d 100644 --- a/nginx/blue.conf +++ b/nginx/blue.conf @@ -1,7 +1,81 @@ +upstream gateway { + server gateway-blue:8081; +} +upstream tool-sms { + server tool-sms-blue:8082; +} +upstream tool-email { + server tool-email-blue:8083; +} +upstream tool-other { + server tool-other-blue:8084; +} +upstream tool-payment { + server tool-payment-blue:8085; +} + server { - listen 8281; + listen 8281 http2; location / { - proxy_pass https://www.google.com; - proxy_set_header Host www.google.com; + proxy_pass http://gateway; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8282 http2; + location / { + proxy_pass http://tool-sms; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8283 http2; + location / { + proxy_pass http://tool-email; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8284 http2; + location / { + proxy_pass http://tool-other; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8285 http2; + location / { + proxy_pass http://tool-payment; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; } } diff --git a/nginx/green.conf b/nginx/green.conf index 8dbbf021..5f54fa36 100644 --- a/nginx/green.conf +++ b/nginx/green.conf @@ -1,7 +1,81 @@ +upstream gateway { + server gateway-green:8081; +} +upstream tool-sms { + server tool-sms-green:8082; +} +upstream tool-email { + server tool-email-green:8083; +} +upstream tool-other { + server tool-other-green:8084; +} +upstream tool-payment { + server tool-payment-green:8085; +} + server { - listen 8281; + listen 8281 http2; location / { - proxy_pass https://www.google.com; - proxy_set_header Host www.google.com; + proxy_pass http://gateway; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8282 http2; + location / { + proxy_pass http://tool-sms; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8283 http2; + location / { + proxy_pass http://tool-email; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8284 http2; + location / { + proxy_pass http://tool-other; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +server { + listen 8285 http2; + location / { + proxy_pass http://tool-payment; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; } }