--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: app namespace: imagehost annotations: cert-manager.io/cluster-issuer: "dnspod-cluster-issuer" nginx.ingress.kubernetes.io/proxy-body-size: "50m" nginx.ingress.kubernetes.io/proxy-read-timeout: "600" nginx.ingress.kubernetes.io/proxy-send-timeout: "600" 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: - hosts: - image.frytea.com - imagehost-cdn.frytea.com - cdn-imagehost.frytea.com secretName: image-frytea-com-tls rules: - host: image.frytea.com http: paths: - path: / pathType: Prefix backend: service: name: app port: name: web - host: imagehost-cdn.frytea.com http: paths: - path: / pathType: Prefix backend: service: name: app port: name: web - host: cdn-imagehost.frytea.com http: paths: - path: / pathType: Prefix backend: service: name: app port: name: web