macaty opened a new issue #688:
URL: https://github.com/apache/apisix-ingress-controller/issues/688


   ### Issue description
   apisix-ingress is different from nginx-ingress in the same ingress.yaml. the 
issue is different path translation:
   1) In nginx-ingress, "path: /" means "path: /" and "path: /*"
   we can access http://url/aaa
   2) In apisix-ingress,"path: /" means "path: /" only.
   we can't access http://url/aaa, and got a error msg"{"error_msg":"404 Route 
Not Found"}"
   
   ### Environment
   [root@man01 kubesphere]# kubectl version
   Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", 
GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", 
BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", 
Platform:"linux/amd64"}
   Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", 
GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", 
BuildDate:"2021-02-18T16:03:00Z", GoVersion:"go1.15.8", Compiler:"gc", 
Platform:"linux/amd64"}
   [root@man01 kubesphere]# uname -a
   Linux man01 5.4.132-1.el7.elrepo.x86_64 #1 SMP Wed Jul 14 07:42:43 EDT 2021 
x86_64 x86_64 x86_64 GNU/Linux
   [root@man01 kubesphere]# kubectl get deployments.apps -n ingress-apisix  -o 
wide
   NAME                        READY   UP-TO-DATE   AVAILABLE   AGE   
CONTAINERS           IMAGES                                   SELECTOR
   apisix                      3/3     3            3           69m   apisix    
           apache/apisix:2.9-alpine                 
app.kubernetes.io/instance=apisix,app.kubernetes.io/name=apisix
   apisix-dashboard            1/1     1            1           59m   
apisix-dashboard     apache/apisix-dashboard:2.8              
app.kubernetes.io/instance=apisix-dashboard,app.kubernetes.io/name=apisix-dashboard
   apisix-ingress-controller   1/1     1            1           69m   
ingress-controller   apache/apisix-ingress-controller:1.2.0   
app.kubernetes.io/instance=apisix,app.kubernetes.io/name=ingress-controller
   
   
   ### Minimal test code / Steps to reproduce the issue
   
   1.Apply the the same ingress.yaml with annotations: apisix
   kind: Ingress
   apiVersion: extensions/v1beta1
   metadata:
     name: nginx-8y63fw
     namespace: dev
     labels:
       app.kubernetes.io/instance: nginx-8y63fw
       app.kubernetes.io/managed-by: Helm
       app.kubernetes.io/name: nginx
       app.kubesphere.io/instance: nginx-8y63fw
       helm.sh/chart: nginx-1.3.5
     annotations:
       kubernetes.io/ingress.class: apisix
       kubesphere.io/creator: admin
       meta.helm.sh/release-name: nginx-8y63fw
       meta.helm.sh/release-namespace: dev
   spec:
     rules:
       - host: nginx.local
         http:
           paths:
             - path: /
               pathType: ImplementationSpecific
               backend:
                 serviceName: nginx-8y63fw
                 servicePort: http
   
   2. curl different url between apisix-ingress and nginx-ingress
   (1)In apisix-ingress
   [root@man01 kubesphere]# kubectl get svc -A | grep gate
   ingress-apisix                 apisix-gateway                               
NodePort       10.233.50.109   <none>        80:6208/TCP                       
72m
   
   [root@man01 kubesphere]#  curl http://10.233.50.109/ -H 'host: nginx.local'
   <!DOCTYPE html>
   <html>
   <head>
   <title>Welcome to nginx!</title>
   <style>
       body {
           width: 35em;
           margin: 0 auto;
           font-family: Tahoma, Verdana, Arial, sans-serif;
       }
   </style>
   </head>
   <body>
   <h1>Welcome to nginx!</h1>
   <p>If you see this page, the nginx web server is successfully installed and
   working. Further configuration is required.</p>
   
   <p>For online documentation and support please refer to
   <a href="http://nginx.org/";>nginx.org</a>.<br/>
   Commercial support is available at
   <a href="http://nginx.com/";>nginx.com</a>.</p>
   
   <p><em>Thank you for using nginx.</em></p>
   </body>
   </html>
   [root@man01 kubesphere]#  curl http://10.233.50.109/aaa -H 'host: 
nginx.local'
   {"error_msg":"404 Route Not Found"}
   
   (2)in nginx-ingress
   [root@man01 kubesphere]#  curl http://10.233.5.82/ -H 'host: nginx.local'
   <!DOCTYPE html>
   <html>
   <head>
   <title>Welcome to nginx!</title>
   <style>
       body {
           width: 35em;
           margin: 0 auto;
           font-family: Tahoma, Verdana, Arial, sans-serif;
       }
   </style>
   </head>
   <body>
   <h1>Welcome to nginx!</h1>
   <p>If you see this page, the nginx web server is successfully installed and
   working. Further configuration is required.</p>
   
   <p>For online documentation and support please refer to
   <a href="http://nginx.org/";>nginx.org</a>.<br/>
   Commercial support is available at
   <a href="http://nginx.com/";>nginx.com</a>.</p>
   
   <p><em>Thank you for using nginx.</em></p>
   </body>
   </html>
   [root@man01 kubesphere]#  curl http://10.233.5.82/aaa -H 'host: nginx.local'
   <html>
   <head><title>404 Not Found</title></head>
   <body>
   <center><h1>404 Not Found</h1></center>
   <hr><center>nginx/1.19.2</center>
   </body>
   </html>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to