-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomepage-ingress.yaml
More file actions
40 lines (39 loc) · 1.07 KB
/
Copy pathhomepage-ingress.yaml
File metadata and controls
40 lines (39 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# TODO: Add a homepage. Until then, redirect '/' to '/nextcloud' for now
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: homepage-ingress
namespace: nextcloud
spec:
routes:
- kind: Rule
match: PathPrefix(`/`)
middlewares:
- name: redirect-to-nextcloud
namespace: nextcloud
# Traefik requires us to put a service here but it can be anything since it never runs because we always redirect
services:
- kind: Service
name: nextcloud-server
namespace: nextcloud
port: 80
# https://traefik.io/blog/https-on-kubernetes-using-traefik-proxy/
# https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/#kind-ingressroute
tls:
secretName: my-tls-secret
domains:
- main: cloud
sans:
- "cloud.local"
- "cloud.lan"
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
creationTimestamp: null
name: redirect-to-nextcloud
namespace: nextcloud
spec:
redirectRegex:
regex: https://([a-z.]+)(/?)(.*)
replacement: https://$1/nextcloud/$3