- 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.
54 lines
3.3 KiB
YAML
54 lines
3.3 KiB
YAML
---
|
|
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/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
|
|
|