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.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 | 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