Closed Slyke closed 2 years ago
@Slyke: 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.
Based on above 2 bullets, it is best that you discuss this in the ingress-nginx-users channel on kubernetes.slack.com . There is no documented process here https://kubernetes.github.io/ingress-nginx/, that seems related to what you are attempting.
/remove-kind bug /kind support
Hello, I figured out how to do this: https://kubernetes.github.io/ingress-nginx/examples/rewrite/
Was as easy as:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: your-ingress
namespace: cert-manager
annotations:
cert-manager.io/acme-challenge-type: http01
kubernetes.io/ingress.class: nginx
cert-manager.io/issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/rewrite-target: /$1 # Pass capture group here
name: your-ingress
namespace: cert-manager
spec:
rules:
- host: your-domain.com
http:
paths:
- path: /(.*) # Setup capture group here
pathType: Prefix
backend:
service:
name: your-service
port:
number: 80
tls:
- hosts:
- your-domain.com
secretName: your-domain.com-tls-cert
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):Environment:
Cloud provider or hardware configuration: Bare-metal
OS (e.g. from /etc/os-release):
Ubuntu
Kernel (e.g.
uname -a
):Linux k-m-001 5.11.0-31-generic #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Install tools:
Basic cluster related info:
kubectl version
kubectl get nodes -o wide
How was the ingress-nginx-controller installed:
helm ls -A | grep -i ingress
Current State of the controller:
kubectl describe ingressclasses
kubectl -n <ingresscontrollernamespace> get all -A -o wide
kubectl -n <ingresscontrollernamespace> describe po <ingresscontrollerpodname>
kubectl -n <ingresscontrollernamespace> describe svc <ingresscontrollerservicename>
The result of these commands are huge.
What happened:
Ingress controller returns 404 for all service routes.
What you expected to happen:
Should be able to navigate to mydomain.xyz/ and the URL be forwarded to the reverse proxy.
How to reproduce it:
To Reproduce Steps to reproduce the behavior:
Ingress for reverse proxy's service:
My reverse proxy default.conf:
If
nginx.ingress.kubernetes.io/rewrite-target: /
is not set, the ingress controller returns 404. If it is set, then the ingress controller will forward the request to the downstream reverse proxy, but it will only forward what is explicitly set here. With it only/
, it will always returnDefault route
even when navigating tomydomain.xyz/test
. I can cURL the downstream reverse proxy directly and see that it is returning the correct response for each route.Anything else we need to know: Controller startup logs:
/kind bug