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

fix: proxy-rewrite should set ngx.var.uri #9309

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

kingluo
Copy link
Contributor

@kingluo kingluo commented Apr 14, 2023

Description

Besides custom upstream_uri var, it should set ngx.var.uri to keep compatible.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@@ -317,6 +318,8 @@ function _M.rewrite(conf, ctx)
upstream_uri = core.utils.uri_safe_encode(upstream_uri)
end

req_set_uri(upstream_uri)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we don't need to set uri when use_real_request_uri_unsafe is true, because in that case, the upstream_uri is supposed to take precedence.

@kingluo kingluo marked this pull request as ready for review April 14, 2023 07:45
@monkeyDluffy6017 monkeyDluffy6017 merged commit 5415916 into apache:master Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants