diff --git a/internal/mode/static/nginx/modules/src/httpmatches.js b/internal/mode/static/nginx/modules/src/httpmatches.js index 1f36ae57ec..0fcf5ef210 100644 --- a/internal/mode/static/nginx/modules/src/httpmatches.js +++ b/internal/mode/static/nginx/modules/src/httpmatches.js @@ -46,14 +46,7 @@ function redirect(r) { return; } - // If performing a rewrite, $request_uri won't be used, - // so we have to preserve args in the internal redirect. - let args = qs.stringify(r.args); - if (args) { - args = '?' + args; - } - - r.internalRedirect(match.redirectPath + args); + r.internalRedirect(match.redirectPath); } function extractMatchesFromRequest(r) { diff --git a/internal/mode/static/nginx/modules/test/httpmatches.test.js b/internal/mode/static/nginx/modules/test/httpmatches.test.js index ac020abba9..65685ea33a 100644 --- a/internal/mode/static/nginx/modules/test/httpmatches.test.js +++ b/internal/mode/static/nginx/modules/test/httpmatches.test.js @@ -403,7 +403,7 @@ describe('redirect', () => { method: 'GET', headers: ['header1:value1', 'header2:value2'], params: ['Arg1=value1', 'arg2=value2=SOME=other=value'], - redirectPath: '/a-match', + redirectPath: '/a-match?Arg1=value1&arg2=value2%3DSOME%3Dother%3Dvalue', }; const tests = [