You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ecoupal-believe (via GitHub)" <gi...@apache.org> on 2023/02/14 13:42:34 UTC
[GitHub] [apisix-ingress-controller] ecoupal-believe opened a new issue, #1669: feat: As a user, I would like a strip-path annotation feature like kong has
ecoupal-believe opened a new issue, #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669
### Description
I have an ingress that look like that:
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api
annotations:
k8s.apisix.apache.org/strip-path: "true"
spec:
ingressClassName: apisix
rules:
- host: api.mycorp
http:
paths:
- path: /api1
pathType: Prefix
backend:
service:
name: api1
port:
number: 80
- path: /api2
pathType: Prefix
backend:
service:
name: api2
port:
number: 80
- path: /api3
pathType: Prefix
backend:
service:
name: api3
port:
number: 80
```
I want the upstream path to look like `/test-action?apikey=1234` when I access the following url url: `https://api.mycorp/api2/test-action?apikey=1234`
I already tried with `k8s.apisix.apache.org/rewrite-target-regex` and `k8s.apisix.apache.org/rewrite-target-regex-template` without any success.
--
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: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1432355331
Sorry for the delay.
So your goal is to rewrite `/$1/$2?apikey=1234` to` /$2?apikey=1234` right?
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] dangviettuan commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "dangviettuan (via GitHub)" <gi...@apache.org>.
dangviettuan commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1461142916
@ecoupal-believe Could you please share your configuration on how to apply proxy-rewrite on k8s?
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] dangviettuan commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "dangviettuan (via GitHub)" <gi...@apache.org>.
dangviettuan commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1461753139
Thanks @ecoupal-believe in my code I have to replace `k8s.apisix.apache.org/plugin-config-name` by `apisix.apache.org/plugin-config-name`
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] ecoupal-believe commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "ecoupal-believe (via GitHub)" <gi...@apache.org>.
ecoupal-believe commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1461539931
You can apply something like that:
```
apiVersion: apisix.apache.org/v2
kind: ApisixPluginConfig
metadata:
name: my-plugin-config
spec:
plugins:
- config:
regex_uri:
- ^/[^/?]+/{0,1}(.*)
- /$1
enable: true
name: proxy-rewrite
```
An then attach it to your ingress:
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
k8s.apisix.apache.org/plugin-config-name: my-plugin-config
name: my-ingress
spec:
ingressClassName: apisix
rules:
- http:
paths:
- backend:
service:
name: my-service
port:
number: 80
path: /my-service
pathType: Prefix
```
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1432356373
> If set to true, the part of the path specified in the Ingress rule will be stripped out before the request is sent to the service. For example, if the Ingress rule has a path of /foo and the HTTP request that matches the Ingress rule has the path /foo/bar/something, then the request sent to the Kubernetes service will have the path /bar/something.
https://docs.konghq.com/kubernetes-ingress-controller/latest/references/annotations/#konghqcomstrip-path
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] feat: As a user, I would like a strip-path annotation feature like kong has [apisix-ingress-controller]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
URL: https://github.com/apache/apisix-ingress-controller/issues/1669
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] ecoupal-believe commented on issue #1669: feat: As a user, I would like a strip-path annotation feature like kong has
Posted by "ecoupal-believe (via GitHub)" <gi...@apache.org>.
ecoupal-believe commented on issue #1669:
URL: https://github.com/apache/apisix-ingress-controller/issues/1669#issuecomment-1432677668
Yes, I actually found a way using proxy-rewrite plugin and/or rewrite-target-regex. This could be an easy feature to work on.
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org