kind: ConfigMap
apiVersion: v1
metadata:
  name: redirector-config
data:
  redirects.conf: |
    {{- range $redirect := .Values.redirector.redirects }}
    server {
          listen 80;
          server_name {{ $redirect.host.from }};

    {{- if (eq $redirect.type "url") }}
          rewrite (.*) https://{{ $redirect.host.to }} redirect;
    {{- else }}
          rewrite (.*) https://{{ $redirect.host.to }}$1 redirect;
    {{- end }}
    }
    {{ end }}
