[英]traefik ingressroute - URL should redirect to a default path
kubernetes 入口規則,如果 URL 中未提供路徑,AWS ALB 規則具有默認路徑規則。 我無法在 Traefik ingressroute 中找到類似的配置。 現在 - https://example.com轉到默認的 Wildfly 頁面。 https://example.com/foo進入應用登錄頁面。 如何配置以便https://example.com直接轉到https://example.com/foo
Ingressroute:
spec:
entryPoints:
- web
- websecure
routes:
- kind: Rule
match: Host(`example.com`) && PathPrefix(`/`)
middlewares:
- name: https-redirect
namespace: ns
services:
- name: service-1
port: 80
另一個入口路由:
spec:
entryPoints:
- web
routes:
- match: Host(`example.com`)
kind: Rule
middlewares:
- name: https-redirect
services:
- name: service-1
port: 80
中間件:
kind: Middleware
metadata:
name: https-redirect
spec:
redirectScheme:
scheme: https
permanent: true
根據Traefik
文檔,您可以像這樣創建一個典型的defaultBackend
Kubernetes Ingress
:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cheese
spec:
defaultBackend:
service:
name: stilton
port:
number: 80
然后,您可以為此Ingress
設置優先級,以確保它匹配正確的請求類型,如traefik.ingress.kubernetes.io/router.priority
注釋。 您可以在此處閱讀有關此內容的更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.