From 2931f4ac8d7d4c7cc3c07268920b5afd53de5bb3 Mon Sep 17 00:00:00 2001 From: liyongzhi02 Date: Thu, 9 Oct 2025 15:19:08 +0800 Subject: [PATCH 1/2] fix: Fix the MimIO URL port issue in the Nginx reverse proxy environment(#28) - Fix the problem of standard ports 443 and 80 being displayed in the url - Support the Nginx HTTPS reverse proxy environment --- src/utils/minio.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/minio.ts b/src/utils/minio.ts index a839a38..3f4cce8 100644 --- a/src/utils/minio.ts +++ b/src/utils/minio.ts @@ -82,7 +82,14 @@ export async function storeBufferToMinIO( const protocol = useSSL ? "https" : "http"; const endPoint = process.env.MINIO_ENDPOINT || "localhost"; const port = process.env.MINIO_PORT || "9000"; - const url = `${protocol}://${endPoint}:${port}/${BUCKET_NAME}/${objectName}`; + + // Fix for issue #28: Don't include standard ports in URL to support Nginx reverse proxy + const isStandardPort = + (protocol === "https" && port === "443") || + (protocol === "http" && port === "80"); + const url = isStandardPort + ? `${protocol}://${endPoint}/${BUCKET_NAME}/${objectName}` + : `${protocol}://${endPoint}:${port}/${BUCKET_NAME}/${objectName}`; return url; } catch (error) { From 73bb7a6bf7b3592fbf9beb2f37460a59a72d2f58 Mon Sep 17 00:00:00 2001 From: liyongzhi02 Date: Thu, 9 Oct 2025 15:24:46 +0800 Subject: [PATCH 2/2] docs(minio): Remove the incorrect references in the code comments --- src/utils/minio.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/minio.ts b/src/utils/minio.ts index 3f4cce8..f7a5948 100644 --- a/src/utils/minio.ts +++ b/src/utils/minio.ts @@ -83,7 +83,7 @@ export async function storeBufferToMinIO( const endPoint = process.env.MINIO_ENDPOINT || "localhost"; const port = process.env.MINIO_PORT || "9000"; - // Fix for issue #28: Don't include standard ports in URL to support Nginx reverse proxy + // Don't include standard ports in URL to support Nginx reverse proxy const isStandardPort = (protocol === "https" && port === "443") || (protocol === "http" && port === "80");