kubernetes / ingress-nginx

Ingress-NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
16.95k stars 8.14k forks source link

Nginx 503 error why trying rewrite ingress address #11192

Open ZrytyADHD opened 3 months ago

ZrytyADHD commented 3 months ago

Hi, I have a question anyone have a issue with redirecting to NGINX Ingress from F5 or Haproxy ? I need to rewrite address from app1.kube-dev.example.com which is served by NGINX with TLS to app1-dev.example.com on haproxy Configuration is OK app1.kube-dev.example.com work like a charm but when I try to access it with address from haproxy app1-dev.example.com i get 503 error. What shoud I configure to get it work. This config is required to expose my app to internet.

k8s-ci-robot commented 3 months 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.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 3 months ago

not tested or supported. check the https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/ information

ZrytyADHD commented 3 months ago

not tested or supported. check the https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/ information

Ok but it is a simple redirect in my opinion. My ingress address is : https://app1.kube-dev.example.com/ My Haproxy/F5 adress is : https://app1-dev.example.com/

So when user enter in web browser https://app1-dev.example.com/ shoud be redirected thru haproxy/f5 to address https://app1.kube-dev.example.com/ and be able to see application page but we got 503.

longwuyuan commented 3 months ago

Call me on slack if you want a discussion. Also wait for other comments.

On Wed, 3 Apr, 2024, 12:11 pm ZrytyADHD, @.***> wrote:

not tested or supported. check the https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/ information

Ok but it is a simple redirect in my opinion. My ingress address is : https://app1.kube-dev.example.com/ My Haproxy/F5 adress is : https://app1-dev.example.com/

So when user enter in web browser https://app1-dev.example.com/ shoud be redirected thru haproxy/f5 to address https://app1.kube-dev.example.com/ and be able to see application page but we got 503.

— Reply to this email directly, view it on GitHub https://github.com/kubernetes/ingress-nginx/issues/11192#issuecomment-2033675843, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZVWQ2AJWH4LAQA6QBAHLY3OQBBAVCNFSM6AAAAABFUCZVROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTGY3TKOBUGM . You are receiving this because you commented.Message ID: @.***>

strongjz commented 3 months ago

Are you using this project ingress-nginx controller for the redirects or F5 nginx controller?

@longwuyuan can you follow up with a close if this is not needed

/triage needs-information

ZrytyADHD commented 3 months ago

Are you using this project ingress-nginx controller for the redirects or F5 nginx controller?

@longwuyuan can you follow up with a close if this is not needed

/triage needs-information

I have a Tanzu Cluster and installed Nginx Ingress Controller on it. F5 or Haproxy are external.

The trafic look like: User-> Address on F5/Haproxy -> Ingress Address from Nginx Controller.-> Service - > App in Pod

After few experiments I was able to run this with haproxy ingress controller and I think the problem is with ports which are used in service and haproxy configuration: http Listening port is 80 and Target is 8080 https Listening port 443 and Target port is 8443

Haproxy backend is set to port 443.

I don't tell anything about rest of the setup. Configuration: Tanzu Kubernetes Cluster - TKGs with NSX Load Balancer.

EDIT: Additional info which can help:

I'm using Nginx with specific IP for exampler 10.1.1.10 and when try to rewrite address https://app1.kube-dev.example.com to https://app1-dev.example.com it always point me to page which is displayed by kubernetes internal proxy : https:ingress-nginx-controller:443/proxy/

So I think I need some rule or DNS entry. I use wildcard certificate kube-dev.example.com pointing IP. 10.1.1.10 maybe this is a problem.

strongjz commented 2 months ago

Can you put in a rewrite or a redirect at the haproxy level?

github-actions[bot] commented 1 month ago

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.