feat(nginx-reverse-proxy): add custom error pages and update configuration for error handling
This commit is contained in:
@@ -24,6 +24,7 @@ locals {
|
||||
|
||||
services_config = {
|
||||
for k, v in var.services : "${k}.conf" => coalesce(v.config, templatefile("${path.module}/resources/nginx/conf.d/default.conf.tpl", {
|
||||
errors = local.error_codes
|
||||
http_port = v.http_port
|
||||
https_port = v.https_port
|
||||
upstream = v.upstream
|
||||
@@ -46,5 +47,12 @@ locals {
|
||||
|
||||
auth_script = file("${path.module}/resources/auth/auth_server.py")
|
||||
auth_script_checksum = sha256(local.auth_script)
|
||||
|
||||
error_codes = [for f in fileset("${path.module}/resources/errors", "*.html") : split(".", f)[0]]
|
||||
errors_pages = {
|
||||
for f in local.error_codes :
|
||||
"${f}.html" => file("${path.module}/resources/errors/${f}.html")
|
||||
}
|
||||
errors_pages_checksum = sha256(jsonencode(local.errors_pages))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user