From fa216b11066be68f1c109c6f741d627050b4ff4d Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Wed, 15 Apr 2026 19:51:56 +0300 Subject: [PATCH 1/2] helm: allow disabling backend service --- helm/config/default.conf | 14 ++++++++------ helm/values.yaml | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/helm/config/default.conf b/helm/config/default.conf index 7e0b8cb..7b43a0a 100644 --- a/helm/config/default.conf +++ b/helm/config/default.conf @@ -31,11 +31,6 @@ server { {{ include "nginx.otelTrace" . | nindent 8 }} - # Allow extending root path with custom configurations - {{- if .Values.nginx.extensions.location.enabled }} - include /etc/nginx/conf.d/extensions/{{ .Values.nginx.extensions.location.fileName }}; - {{- end }} - set $original_method $request_method; set $original_args $args; @@ -47,7 +42,14 @@ server { otel_span_attr opa.reason $opa_reason; {{ end }} - proxy_pass http://{{ .Values.backend.host }}:{{ .Values.backend.port }}; + # Allow extending root path with custom configurations + {{- if .Values.nginx.extensions.location.enabled }} + include /etc/nginx/conf.d/extensions/{{ .Values.nginx.extensions.location.fileName }}; + {{- end }} + + {{- if .Values.backend.enabled }} + proxy_pass http://{{ .Values.backend.host | default "localhost" }}:{{ .Values.backend.port }}; + {{- end }} } {{ if .Values.authorization.enabled }} diff --git a/helm/values.yaml b/helm/values.yaml index 171bd4f..f7589e1 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -116,8 +116,10 @@ extraVolumeMounts: [] sidecars: "" backend: + # -- Enable or disable the backend service + enabled: true # -- Backend service name for proxy_pass - host: "backend-service" + host: '' # -- Backend service port port: 8080 From 1430b43cc057b2a361bb2da772521c2aae701bcd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Apr 2026 16:52:47 +0000 Subject: [PATCH 2/2] update Helm documentation --- helm/values.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helm/values.md b/helm/values.md index 4679340..3307742 100644 --- a/helm/values.md +++ b/helm/values.md @@ -18,7 +18,8 @@ A Helm chart for nginx | authorization.domain | string | `"example"` | Your authorization domain | | authorization.enabled | bool | `true` | Use authroization mechanism | | authorization.url | string | `"http://localhost:8181/v1/data/http/authz/decision"` | Authorization endpoint | -| backend.host | string | `"backend-service"` | Backend service name for proxy_pass | +| backend.enabled | bool | `true` | Enable or disable the backend service | +| backend.host | string | `""` | Backend service name for proxy_pass | | backend.port | int | `8080` | Backend service port | | caKey | string | `"ca.crt"` | Key in the CA secret that contains the certificate data | | caPath | string | `"/usr/local/share/ca-certificates"` | Path where the CA certificate will be mounted in the container |