You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "taherbohri (via GitHub)" <gi...@apache.org> on 2025/11/21 10:00:34 UTC
[I] request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting . [apisix-ingress-controller]
taherbohri opened a new issue, #2660:
URL: https://github.com/apache/apisix-ingress-controller/issues/2660
### Issue description
**HI Team,
I have been trying to modify the Uri for incoming calls to some different desired path before forwrding it to the upstream using the apisix's "regex_uri and uri" feature fo "proxy-rewrite plugin" but nothing seems to work,
Pugin gets attached, seeing no ingress errors, all looks good with deployment part but, while hitting the apisix url with path "/management-service/healthcheck". calls should be forwarded to "upstreamhost//management-service/health" but rather they still land on the route path "upstream//management-service/healthcheck", need help fixing this, all config I have pasted below**.
Apisix Upstream -
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
name: strip-path-upstream
namespace: apisix-ns
labels:
app.kubernetes.io/name: strip-path
app.kubernetes.io/instance: example
spec:
scheme: https
timeout:
connect: "3s"
send: "8s"
read: "8s"
retries: 0
passHost: "node"
externalNodes:
- type: Domain
name: "internal.carbon.com"
port: 443
weight: 1
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
name: strip-path-upstream
namespace: apisix-ns
labels:
app.kubernetes.io/name: strip-path
app.kubernetes.io/instance: example
spec:
scheme: https
timeout:
connect: "3s"
send: "8s"
read: "8s"
retries: 0
passHost: "rewrite"
externalNodes:
- type: Domain
name: "internal.carbon.com"
port: 443
weight: 1
upstreamHost: "internal.carbon.com"
ApsixRoute -
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: strip-path-apisixroute
namespace: apisix-ns
labels:
app.kubernetes.io/instance: example
spec:
ingressClassName: apisix
http:
- name: strip-path-test-route
match:
methods:
- "GET"
- "OPTIONS"
paths:
- "/management-service/healthcheck"
upstreams:
- name: strip-path-upstream
plugin_config_name: strip-path-pluginconfig
plugin with regex_uri feature of proxy-rewrite -
apiVersion: apisix.apache.org/v2
kind: ApisixPluginConfig
metadata:
name: strip-path-pluginconfig
namespace: apisix-ns
spec:
ingressClassName: apisix
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri:
- ^(/management-service/.*/)(healthcheck)$
- $1health
Also tried plugin with uri feature of proxy-rewrite -
apiVersion: apisix.apache.org/v2
kind: ApisixPluginConfig
metadata:
name: strip-path-pluginconfig
namespace: apisix-ns
spec:
ingressClassName: apisix
plugins:
- name: proxy-rewrite
enable: true
config:
method: GET
uri: /management-service/health
---
### Environment
Environment
APISIX version: 3.13.0
APISIX Ingress Controller: 2.0.0-rc5
Deployment mode: Standalone (apisix-standalone provider)
Gateway API: v1
Platform: Kubernetes
--
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
Re: [I] request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting . [apisix-ingress-controller]
Posted by "taherbohri (via GitHub)" <gi...@apache.org>.
taherbohri commented on issue #2660:
URL: https://github.com/apache/apisix-ingress-controller/issues/2660#issuecomment-3569795932
This issue is fixed, thanks for the help .
--
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] request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting . [apisix-ingress-controller]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #2660: request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting .
URL: https://github.com/apache/apisix-ingress-controller/issues/2660
--
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] request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting . [apisix-ingress-controller]
Posted by "bzp2010 (via GitHub)" <gi...@apache.org>.
bzp2010 commented on issue #2660:
URL: https://github.com/apache/apisix-ingress-controller/issues/2660#issuecomment-3570840672
If convenient, please share the issue you encountered and how you ultimately resolved it here. I'm sure this will benefit the entire community.
Thank you.
--
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] request help: Apisix plugin - proxy-rewrite is not working for uri/path rewriting . [apisix-ingress-controller]
Posted by "bzp2010 (via GitHub)" <gi...@apache.org>.
bzp2010 commented on issue #2660:
URL: https://github.com/apache/apisix-ingress-controller/issues/2660#issuecomment-3565349783
Please use the Admin API to list the original configuration. This API is exposed on APISIX pod.
`curl http://<ip>:9180/apisix/admin/configs -H "X-API-KEY: <apikey>"`
--
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