From 9f3879c25b5e3580a724f8a90394664d86348028 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 15 Apr 2025 14:35:55 +0800 Subject: [PATCH] fix: update ingress configuration for Avatar.jpg - Modify ingress configuration to redirect requests for /Avatar.jpg to a specific URL. - Ensure that the redirection includes query parameters. - Comment out the old rewrite rule for clarity. This update addresses the routing for Avatar.jpg, ensuring that requests are properly directed to the desired image location, improving accessibility for users. --- imagehost/ingress.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/imagehost/ingress.yaml b/imagehost/ingress.yaml index 58eac7d..54c3f5b 100644 --- a/imagehost/ingress.yaml +++ b/imagehost/ingress.yaml @@ -6,10 +6,11 @@ metadata: namespace: imagehost annotations: cert-manager.io/cluster-issuer: "dnspod-cluster-issuer" - #nginx.ingress.kubernetes.io/configuration-snippet: | - # location ~ ^/([^/]+\.jpg)$ { - # return 301 $scheme://$host/i/$1; - # } + nginx.ingress.kubernetes.io/configuration-snippet: | + location = /Avatar.jpg { + return 301 https://image.frytea.com/i/Avatar.jpg$is_args$args; + } + #nginx.ingress.kubernetes.io/rewrite-rule: "if ($uri ~ ^/(Avatar\\.jpg)$) { return 301 $scheme://$host/i/$1; }" spec: ingressClassName: nginx tls: