diff --git a/terraform/module.tf b/terraform/module.tf index e2366e1..f2a10fe 100644 --- a/terraform/module.tf +++ b/terraform/module.tf @@ -8,6 +8,7 @@ variable "nginx_sites" { enabled = optional(bool, true) proxy_cache = optional(bool, false) extra-value = optional(string, "") + extra-value-location = optional(string, "") http2_bool = optional(bool, false) proxy_pass_https = optional(bool, false) authentication_required = optional(bool, false) @@ -23,6 +24,7 @@ resource "local_file" "nginx" { name_service = each.value.service proxy_cache = each.value.proxy_cache extra-value = each.value.extra-value + extra-value-location = each.value.extra-value-location http2_bool = each.value.http2_bool proxy_pass_https = each.value.proxy_pass_https authentication_required = each.value.authentication_required @@ -79,6 +81,7 @@ resource "kubernetes_config_map" "automatic-configmap" { name_service = value.service proxy_cache = value.proxy_cache extra-value = value.extra-value + extra-value-location = value.extra-value-location http2_bool = value.http2_bool proxy_pass_https = value.proxy_pass_https authentication_required = value.authentication_required diff --git a/terraform/nginx_config.tftpl b/terraform/nginx_config.tftpl index ff5fffa..e122f03 100644 --- a/terraform/nginx_config.tftpl +++ b/terraform/nginx_config.tftpl @@ -13,6 +13,7 @@ server { proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; + ${extra-value-location} %{ if authentication_required} auth_basic "Administrator’s Area"; auth_basic_user_file /authentication-htpasswd/.htpasswd; diff --git a/terraform/variables.auto.tfvars b/terraform/variables.auto.tfvars index 4d8494e..7902fed 100644 --- a/terraform/variables.auto.tfvars +++ b/terraform/variables.auto.tfvars @@ -5,9 +5,11 @@ nginx_sites = { } bookstack = { - service = "webserver.bookstack.svc" + # service = "webserver.bookstack.svc" + service = "bookstack-svc.bookstack.svc" proxy_cache = false } + django = { service = "webserver.django-python.svc:8000" proxy_cache = true @@ -35,6 +37,7 @@ client_max_body_size 20m; keycloak = { service = "keycloak.keycloak.svc:8080" + enabled = false extra-value = <

health check

\n"; + } + EOT + } + + bookstack-terraform = { + enabled = false + service = "bookstack-svc.bookstack-terraform.svc" + } + stash = { + enabled = false + service = "stash-svc.stash.svc:9999" + extra-value = <