【发布时间】:2021-04-25 13:54:32
【问题描述】:
我有一个 traefik 像这样暴露的 K8s 设置
kubernetes:
ingressClass: traefik
service:
nodePorts:
http: 32080
serviceType: NodePort
后面,我将一些请求转发给不同的服务
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-name
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: my-host.com
http:
paths:
- path: /my-first-path
backend:
serviceName: my-nodeJs-services
servicePort: 3000
当 DNS 直接设置为解析到我的 ip 时,应用程序可以正常使用 HTTP
http://my-host.com:32080/my-first-path
但是当有人通过 AWS ALB / API Gateway 添加 SSL 时,应用程序无法访问并出现 404-NotFound 错误
路线是这样的 https://my-host.com/my-first-path
在 AWS 大小上,他们配置了类似的东西
https://my-host.com => SSL Termination and => Forward all to 43.43.43.43:32080
我认为这失败了,因为 traefik 期待 http://my-host.com 而不是 https://my-host.com 导致它无法找到匹配的路线?或者可能在 ssl 终止时,主机名丢失,导致 traefik 找不到路由?
在这种情况下我该怎么办?
【问题讨论】:
标签: kubernetes kubernetes-ingress traefik