请教下,我想用如下配置在负载均衡alb上实现这串代码可以吗?

请教下,我想在负载均衡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:

  • hosts:
    • blog.example.com
      这里的query是不是需要修改?请问这个可以怎么实现呢?我测试是不行的

展开
收起
乐天香橙派 2023-09-04 20:08:17 216 分享
分享
版权
举报
阿里云 AI 助理回答

对不起,我已经学习的云计算知识中不包含问题相关内容,暂时无法提供答案。您有阿里云产品相关问题,我会帮助您解答。

有帮助
无帮助
AI 助理回答生成答案可能存在不准确,仅供参考
0 条回答
写回答
取消 提交回答

阿里云负载均衡(Server Load Balancer,简称SLB)是云原生时代应用高可用的基本要素。通过将流量分发到不同的后端服务来扩展应用系统的服务吞吐能力,消除单点故障并提升应用系统的可用性。 阿里云SLB包含面向4层的网络型负载均衡NLB、面向7层的应用型负载均衡ALB和传统型负载均衡CLB,是阿里云官方云原生网关。

热门讨论

热门文章

还有其他疑问?
咨询AI助理
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等