Breandan Dezendorf 2 жил өмнө
parent
commit
f4c6a05212

+ 37 - 2
dezendorf/homelab/k3s/gopy/gopy.yaml

@@ -44,10 +44,36 @@ spec:
   entryPoints:
     - web
   routes:
-  - match: Host(`gopy.dezendorf.net`)
+  - match: Host(`gopy`)||Host(`gopy.dezendorf.net`) && Path(`/`)
+    kind: Rule
+    middlewares:
+      - name: gopyhttpsgofqdn
+    services:
+    - name: gopy
+      port: 5000
+  - match: (Host(`gopy`)||Host(`gopy.dezendorf.net`)) && Path(`/{url:.*}/edit`)
+    kind: Rule
+    middlewares:
+      - name: gopyhttpsgofqdn
+    services:
+    - name: gopy
+      port: 5000
+  - match: (Host(`gopy`)||Host(`gopy.dezendorf.net`)) && Path(`/{url:.*}/add`)
+    kind: Rule
+    middlewares:
+      - name: gopyhttpsgofqdn
+    services:
+    - name: gopy
+      port: 5000
+  - match: (Host(`gopy`)||Host(`gopy.dezendorf.net`)) && Path(`/{url:.*}/delete`)
     kind: Rule
     middlewares:
-    - name: redirecthttps
+      - name: gopyhttpsgofqdn
+    services:
+    - name: gopy
+      port: 5000
+  - match: Host(`gopy`)||Host(`gopy.dezendorf.net`)
+    kind: Rule
     services:
     - name: gopy
       port: 5000
@@ -70,3 +96,12 @@ spec:
       port: 5000
   tls:
     certResolver: myresolver
+---
+apiVersion: traefik.containo.us/v1alpha1
+kind: Middleware
+metadata:
+  name: gopyhttpsgofqdn
+spec:
+  redirectRegex:
+    regex: "^http(s)?://(gopy(.dezendorf.net)?)/(.+)?$"
+    replacement: "https://gopy.dezendorf.net/${4}"