请教下,我想在负载均衡alb上实现blog.example.com/100/ –> exmaple.com/blog/100/,如下的配置可以实现吗?
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
alb.ingress.kubernetes.io/actions.redirect: |
[{
“type”: “Redirect”,
“RedirectConfig”: {
“host”: “example.com”,
“path”: “/blog/”,
“port”: “443”,
“protocol”: “https”,
“query”: “${query}”,
“httpCode”: “301”
}
}]
name: blog-ingress
namespace: devops
spec:
ingressClassName: alb
rules:
-
host: blog.example.com
http:
paths:- path: /
pathType: Prefix
backend:
service:name: redirect port: name: use-annotation
tls:
- path: /
- hosts:
- blog.example.com
这里的query是不是需要修改?请问这个可以怎么实现呢?我测试是不行的
- blog.example.com