Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: wrong request forwarded to the upstream server #11381

Open
lilililizheng opened this issue Jul 1, 2024 · 2 comments
Open

bug: wrong request forwarded to the upstream server #11381

lilililizheng opened this issue Jul 1, 2024 · 2 comments
Labels
wait for update wait for the author's response in this issue/PR

Comments

@lilililizheng
Copy link

Current Behavior

When using a reverse proxy, if in the request URL with parameters, such as: https://192.168.0.253:9443/hello? t=32132432, there will be an error when forwarding upstream. I have captured and traced the packet here, and there should be a coding problem when forwarding upstream. The request result I caught is GET hello%3F=32132432&t=32132432.

This can not be seen in the apisix log, the whole request is completely normal, but the wrong request was forwarded to the upstream server, the server can not handle the error correctly, this problem I roughly traced, it seems that there is a problem with the request:
function _M.set_current_peer(addr, port)
local r = get_request()
print(require("ffi").string(r))
if not r then
error("no request found")
end

if not port then
    port = 0
elseif type(port) ~= "number" then
    port = tonumber(port)
end

local rc = ngx_lua_ffi_balancer_set_current_peer(r, addr, #addr,
                                                 port, errmsg)
if rc == FFI_OK then
    return true
end

return nil, ffi_str(errmsg[0])

end

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

I'm just normal use reverse proxy aapisix doing, just be proxy site some request need take parameters, such as: https://192.168.254.211/initialization/check? t=1719806422715, so if I want to use apisix to proxy this service, it is not successful

Environment

  • APISIX version (run apisix version):3.5.0
  • Operating system (run uname -a):Linux QSG 5.4.196-zesk change: added an example of plugin. #2 SMP Tue Jun 18 16:30:12 CST 2024 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: nginx/1.22.1
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@lilililizheng
Copy link
Author

Looking forward to your handling and reply

@kayx23 kayx23 changed the title bug: bug: wrong request forwarded to the upstream server Jul 1, 2024
@shreemaan-abhishek
Copy link
Contributor

any error logs?

@shreemaan-abhishek shreemaan-abhishek added the wait for update wait for the author's response in this issue/PR label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait for update wait for the author's response in this issue/PR
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants