apps/obsidian/resources/http_routes.yaml

56 lines
1.4 KiB
YAML
Raw Normal View History

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: obsidian-db-http
spec:
parentRefs:
- name: contour
sectionName: http
namespace: projectcontour
hostnames:
- obsidian-db.icb4dc0.de
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 301
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: obsidian-db-https
spec:
parentRefs:
- name: contour
sectionName: https
namespace: projectcontour
hostnames:
- obsidian-db.icb4dc0.de
rules:
- matches:
- method: OPTIONS
headers:
- name: Origin
value: 'app://obsidian.md'
filters:
- type: ResponseHeaderModifier
responseHeaderModifier:
add:
- name: Access-Control-Allow-Origin
value: 'app://obsidian.md'
- name: Access-Control-Allow-Methods
value: 'GET,PUT,POST,HEAD,DELETE'
- name: Access-Control-Allow-Credentials
value: 'true'
- name: Access-Control-Allow-Headers
value: 'accept,authorization,content-type,origin,referer'
- name: Access-Control-Max-Age
value: '3600'
backendRefs:
- name: caddy-hack
port: 8080
- backendRefs:
- name: obsidian-svc-couchdb
port: 5984