mikyll commented on issue #11914:
URL: https://github.com/apache/apisix/issues/11914#issuecomment-2597825432
_Not related to the bug_, but I think the correct way you should do this is
by configuring the `proxy-rewrite` plugin using the `regex_uri` parameter,
instead of `uri` with `$request_uri` 👀
## Example (APISIX Standalone)
File `apisix.yaml`:
```yaml
upstreams:
- id: ext-httpbin
nodes:
"httpbin.org": 1
type: roundrobin
routes:
- id: test
uri: /uuid
upstream_id: ext-httpbin
plugins:
proxy-rewrite:
regex_uri:
# Append '/api' in front of URI
- ^/(.*)
- /api/$1
echo:
body: "hello"
```
Request:
```bash
curl localhost:9080/uuid?id=1
hello
```
Logs:
```text
2025-01-17 10:24:27 172.18.0.1 - - [17/Jan/2025:09:24:24 +0000]
localhost:9080 "GET /uuid?id=1 HTTP/1.1" 200 25 0.000 "-" "curl/8.5.0" - - -
"http://localhost:9080/api/uuid?id=1"
```
--
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]