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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]