﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
2595	Unexpected behaviour between ngx_http_rewrite_module and ngx_http_core_module	Riddr Inc		"Hello,

I'm experiencing weird issue involving nginx variables, rewrite module and the location directive from the http_core module. I'm trying to use variable's value as a rewrite URI. The thing is when I use query parameters in the variable value nginx location directive is trying to access the file with the query arguments included.  

For example, I'm having the following configuration in my server context. 


{{{
set $test /test.php?test=1;
rewrite ^/my/test$ $test last;
}}}

When trying to access the /my/test location I get the following error message: 

{{{
GET /my/test HTTP/2.0"" 404
open() ""/app/public_html/test.php?test=1"" failed (2: No such file or directory)
}}}

When not using variable for the replacement uri everything works fine: 

{{{
rewrite ^/my/test$ /test.php?test=1 last;
GET /my/test HTTP/2.0"" 200
}}}

Is this intentional behaviour due to how nginx is compiling the rewrite directives at configuration stage, or I've stumbled upon some bug? 

"	defect	closed	minor		nginx-module	1.25.x	invalid	rewrite, variable		Linux a34dd1683ec5 6.4.16-linuxkit #1 SMP PREEMPT_DYNAMIC Thu Nov 16 10:55:59 UTC 2023 x86_64 Linux	nginx version: nginx/1.25.3
