ilteriseroglu-ty commented on code in PR #8564:
URL: https://github.com/apache/apisix/pull/8564#discussion_r1057691403


##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -297,6 +297,8 @@ do
         else
             ctx.var.upstream_uri = upstream_uri
         end
+    else
+        ctx.var.upstream_uri = upstream_uri

Review Comment:
   If `use_real_request_uri_unsafe` gets set, the local `upstream_uri` becomes 
`ctx.var.real_request_uri`:
   
   
https://github.com/apache/apisix/blob/0f1391693bf98a38c7716b1091f40181de8690bb/apisix/plugins/proxy-rewrite.lua#L263-L265
   
   `ctx.var.real_request_uri` is used instead of `ctx.var.request_uri` as the 
nginx native `request_uri` is rewritten in init.lua to use the normalized 
version instead:
   
   
https://github.com/apache/apisix/blob/5822eca9a28ff7b92dc7fc0431281eb62dd60ba8/apisix/init.lua#L509-L513
   
   Normally, everything should work *without* this PR (as I authored the 
original `use_real_request_uri_unsafe` change) but, after examining an issue 
where this didn't work half the time when the system was under load; I had to 
set `ctx.var.upstream_uri` to `upstream_uri`, which is set to 
`ctx.var.real_request_uri` because `use_real_request_uri_unsafe` is set.
   
   I am not sure whether this is an issue under LuaJIT or something else.



-- 
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]

Reply via email to