{{- if .Values.matrix.delegation.enabled }} apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx-configmap data: nginx.conf: | worker_processes 1; # The container runs as the unprivileged nginx user with a read-only root # filesystem: pid file and temp paths live in the /tmp emptyDir, and the # listen port is unprivileged (8080). pid /tmp/nginx.pid; events { worker_connections 1024; } http { client_body_temp_path /tmp/client_temp; proxy_temp_path /tmp/proxy_temp; fastcgi_temp_path /tmp/fastcgi_temp; uwsgi_temp_path /tmp/uwsgi_temp; scgi_temp_path /tmp/scgi_temp; server { listen 8080; location /.well-known/matrix/server { return 200 '{"m.server": "{{ required "A Domain/Host must be provided (ingress.domain)" .Values.ingress.domain }}:443"}'; add_header Content-Type application/json; } location /.well-known/matrix/client { return 200 '{"m.homeserver": {"base_url": "https://{{ required "A Domain/Host must be provided (ingress.domain)" .Values.ingress.domain }}"}}'; add_header Content-Type application/json; add_header "Access-Control-Allow-Origin" *; } } } {{- end }}