From 339c9348359cbbb435f135891ee41027a1538eea Mon Sep 17 00:00:00 2001 From: wizzdom Date: Fri, 11 Oct 2024 14:31:40 +0100 Subject: [PATCH] ingress/gate: add fallback route --- jobs/ingress/gate-proxy.hcl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jobs/ingress/gate-proxy.hcl b/jobs/ingress/gate-proxy.hcl index be16374..3c9afca 100644 --- a/jobs/ingress/gate-proxy.hcl +++ b/jobs/ingress/gate-proxy.hcl @@ -57,7 +57,18 @@ config: {{- if .Name | regexMatch ".*-mc$" }} {{- range service .Name }} - host: {{ .Name }}.rb.dcu.ie - backend: {{ .Name }}.service.consul:{{ .Port }}{{ end -}}{{ end -}}{{ end -}} + backend: {{ .Name }}.service.consul:{{ .Port }}{{ end -}}{{ end -}}{{ end }} + # Fallback route for when any service is unavailable + - host: '*' + backend: localhost:2000 # backend must exist - this is a dummy value + fallback: + motd: | + §cThis server is offline/does not exist! + §eCheck back later! + version: + name: '§cTry again later!' + protocol: -1 + EOH destination = "local/config.yaml" }