Replies: 1 comment
-
|
have already solved it, thank . "regex_uri": [ "^/boot/?(.*)$", "/$1" ] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to proxy /{prefix}** instead of /{prefix}/**?
How to make http://192.168.254.1:9080/boot accessible successfully?
I visit http://192.168.254.1:9080/boot error:
``` 2025/03/27 03:22:56 [error] 62#62: *153977 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/plugins/proxy-rewrite.lua:340: attempt to use zero-length uri stack traceback: coroutine 0: [C]: in function 'req_set_uri' /usr/local/apisix/apisix/plugins/proxy-rewrite.lua:340: in function 'phase_func' /usr/local/apisix/apisix/plugin.lua:1169: in function 'run_plugin' /usr/local/apisix/apisix/init.lua:689: in function 'http_access_phase' access_by_lua(nginx.conf:317):2: in main chunk, client: 172.22.80.1, server: _, request: "GET /boot HTTP/1.1", host: "192.168.254.1:9080" 2025/03/27 03:22:58 [error] 49#49: *153990 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/plugins/proxy-rewrite.lua:340: attempt to use zero-length uri stack traceback: coroutine 0: [C]: in function 'req_set_uri' /usr/local/apisix/apisix/plugins/proxy-rewrite.lua:340: in function 'phase_func' /usr/local/apisix/apisix/plugin.lua:1169: in function 'run_plugin' /usr/local/apisix/apisix/init.lua:689: in function 'http_access_phase' access_by_lua(nginx.conf:317):2: in main chunk, client: 172.22.80.1, server: _, request: "GET /boot HTTP/1.1", host: "192.168.254.1:9080" 2025/03/27 03:22:59 [error] 57#57: *154042 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/plugins/proxy-rewrite.lua:340: attempt to use zero-length uri stack traceback: ```my route configuration json:
``` { "uri": "/boot**", "name": "test boot route", "methods": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE" ], "plugins": { "proxy-rewrite": { "regex_uri": [ "/boot(.*)$", "$1" ] } }, "upstream": { "nodes": [ { "host": "172.22.80.1", "port": 8900, "weight": 1 } ], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }, "labels": { "API_VERSION": "1.0" }, "enable_websocket": true, "status": 1 } ```my version:
Beta Was this translation helpful? Give feedback.
All reactions