Closed TiepiNL closed 5 months ago
Hi @TiepiNL,
If the nginx template is used with a ClusterIP service and TLS enabled ingress, then the ingress takes care of the ssl handling and forwards http traffic to the service. However, by default this results in a "400 bad request" ("the plain http request was sent to https port").
Could you please share the values you used to deploy the solution and the steps to reproduce the error?
Thanks
I explained the reason in https://github.com/bitnami/charts/issues/25560#issuecomment-2153284852 why the current state is not correct.
The annotation nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
is used in NGINX Ingress to indicate that the communication between the Ingress controller and the backend service should use HTTPS. While this may seem like a good approach for ensuring secure communication between the Ingress and backend services, there are several reasons why it is often considered an anti-pattern:
Complexity in Certificate Management:
Increased Configuration Overhead:
Performance Overheads:
Security Concerns:
TLS Termination at the Ingress:
Service Mesh:
Using nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
can introduce significant complexity, increase the risk of misconfiguration, and lead to performance inefficiencies. For most scenarios, terminating TLS at the ingress and using a service mesh for end-to-end encryption within the cluster is a more scalable, secure, and manageable approach.
Name and Version
bitnami/nginx 17.1.0
What is the problem this feature will solve?
If the nginx template is used with a ClusterIP service and TLS enabled ingress, then the ingress takes care of the ssl handling and forwards http traffic to the service. However, by default this results in a "400 bad request" ("the plain http request was sent to https port").
I have been able to work around this issue by investigating the ingress template at https://github.com/bitnami/charts/blob/main/bitnami/nginx/templates/ingress.yaml#L33. Since containerPorts.https is set by default, the ingress will always create a backend rule for https. Once I manually set containerPorts.https to "", the ingress was configured for a http backend.
What is the feature you are proposing to solve the problem?
I would expect a more intuitive way to make ssl offloading work. For example, based on a "false" value for tls.enabled (https://github.com/bitnami/charts/blob/main/bitnami/nginx/README.md#nginx-deployment-parameters).
What alternatives have you considered?
I've tried to add the annotation
nginx.ingress.kubernetes.io/ssl-redirect: "false"
as described here: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#server-side-https-enforcement-through-redirect, but it didn't seem to help. Which makes sense, since the traffic was already http, the issue is that it's send the the https port.I am quite new to K8s and Helm charts. Perhaps I overlook something?