-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I redirect 80 to 443, and redirect 8000 to 4443 in the same ingress and same load balancer? #4060
Comments
@monelgordillo
Here's how it works, based on the provided configuration: Ingress Group: The Separate Ingresses for HTTP Redirects: You create separate Ingress resources for each HTTP port you want to redirect. ingress-blue-80: Handles traffic on port 80 and redirects it to HTTPS on port 443. The alb.ingress.kubernetes.io/actions.redirect-blue annotation defines this redirect. Note the dummy backend service redirect-blue that is never actually hit. Separate Ingresses for HTTPS Traffic: You also need separate Ingresses to handle the actual HTTPS traffic on ports 443 and 4443. ingress-blue-443: Handles HTTPS traffic on port 443 and routes it to your echoserver service. The alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]' annotation tells the controller to configure the ALB listener for this port. Hope this will help. |
Howdy @shraddhabang , thank you for this. I tried this. I noticed that listener 80 and 443 were created on the load balancer, but unfortunately 8000 and 4443 listeners were not created.
|
I set alb.ingress.kubernetes.io/group.name to be the same for all 4 ingresses. Now, I'm getting this error:
|
I had to get rid of a leftover alb.ingress.kubernetes.io/ssl reference. This the configuration that worked for me:
|
As mentioned here, the |
How can I redirect 80 to 443, and redirect 8000 to 4443 in the same ingress and same load balancer?
Port 80 -> 443 (HTTPS)
Port 8000 -> 4443 (HTTPS)
I tried this, but everything it is not working as expected. Everything is redirecting to 4443.
The text was updated successfully, but these errors were encountered: