We have ingressRoute with "redirect to https" middleware, so every request gets redirect to https.
#HTTP redirect ingressRoute
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: redirect-to-https
spec:
entryPoints:
- web
routes:
- kind: Rule
match: PathPrefix(`/`)
middlewares:
- name: redirect-to-https
priority: 9998
services:
- kind: TraefikService
name: api@internal
However this create issue for acme url, as it also gets redirect to https and cerficate not getting issue. Acme url only works with http.
we tried to add another rule in same ingressroute with highest priority without middleware but its not working. Request still froward to https.
#HTTP redirect ingressRoute
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: redirect-to-https
spec:
entryPoints:
- web
routes:
#For certificates issue request
- kind: Rule
match: PathPrefix(`/.well-known/acme-challenge/`)
priority: 9999 # necessary, if you have further Ingress/IngressRoutes
services:
- kind: TraefikService
name: api@internal
- kind: Rule
match: PathPrefix(`/`)
middlewares:
- name: redirect-to-https
priority: 9998 # necessary, if you have further Ingress/IngressRoutes
services:
- kind: TraefikService
name: api@internal
Please suggest how to exclude "/.well-known/acme-challenge/" from https redirect. Other than this url all other should redirect to https.