Closed LaraibSaleem closed 1 week ago
This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
You have not explained more details so does the below suggestion work for you
Remove all these annotations
kubernetes.io/ingress.allow-http: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "4m"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/ssl-redirect: "false" # Allow both HTTP and HTTPS
nginx.ingress.kubernetes.io/proxy-ssl-server-name: "on"
nginx.ingress.kubernetes.io/proxy-ssl-verify-depth: "2"
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
Remove the service of --type ExternalName
Just use the annotation https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#permanent-redirect
When I access the /v1/users
endpoint for authentication, I receive a 302 redirect, after which the authentication process completes, and I'm returned to our ingress host/domain.
I do not want to redirect everything to the https://DNS.com. I have tried the annotation you provided but this does not solve the problem.
There seem similarities between you sendng request to AUTH outside the cluster like here https://kubernetes.github.io/ingress-nginx/examples/customization/external-auth-headers/
Hello @LaraibSaleem,
I assume https://DNS.com
is pointing to something hosted on CloudFlare. The error message you're receiving tells, that you're trying to send a plain unencrypted HTTP request to the HTTPS port of your target host. Some servers still reply in HTTP and try to tell you that you first need to establish an SSL/TLS connection.
Ingress NGINX by default connects to backends without SSL/TLS. To enable HTTPS on your backend, you need to set the following annotation:
TIL: There is AUTO_HTTP
as a value for this annotation. According to the code this would lead to using the same protocol as you're using on the frontend. As you are defining 443
in your external service, you'll probably need to use HTTPS
here.
Regards Marco
Hey @Gacko Thanks for your input. When I tried the suggested behaviour and accessed my ingress host on the browser, I receive 502.
Regarding the logs on ingress-nginx pod, When I use https, we get errors for frontend upstream server, but with default, that is http, I get error for dns-external-service.
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev
on Kubernetes Slack.
Hey, anyone looking for the solution. I have tried so many workarounds for this particular scenario with many annotations. None of them seemed to work in my favor. So, at last, I have deployed native nginx web-server in a pod as a load balancer, entirely by-passing ingress resource. Closing the issue. Keep Learning.
I have following nginx.conf file which is working perfectly fine in a docker compose setup, that is, /v1/users requests go to https://DNS.com
I'm deploying this app on GKE and using nginx as ingress controller Following is my ingress resource with all its annotations
Following is the external service
The issue I'm currently facing with all these configurations is
400 Bad Request The plain HTTP request was sent to HTTPS port cloudflare
What's expected: On loading the ingress host/domain, it should redirect to https://DNS.com
Note: 1- My ingress cotroller external IP and dns.com are registered in the same domain on cloudflare so I'm using same tls certs in both, nginx.conf and ingress secrets. 2- web and FE are deployed on same cluster 3- dns.com is itself a private IKS (IBMCloud Kubernetes Environment)