我正在尝试根据 Traefik 的文档在我的 kubernetes 集群中测试和实现 Traefik 的https重定向功能: https ://docs.traefik.io/middlewares/overview/ 。这是Middleware
and的定义IngressRoute
:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroutetls
namespace: default
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`your.domain.name`) && Host(`www.your.domain.name`)
kind: Rule
services:
- name: traefik-dashboard
port: 8080
middlewares:
- name: redirectscheme
tls:
secretName: cloud-tls
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: redirectscheme
spec:
redirectScheme:
scheme: https
但是,https ://your.domain.name 有效,而http://your.domain.name给了我一个404 page not found。有谁知道我配置错了什么?