Hello!
On Mon, Nov 18, 2013 at 1:41 AM, DeJiang Zhu wrote:
> 我看 debug 日志也确实不一样:
> 2013/11/18 17:15:19 [notice] 19179#0: *2 rewritten data: "/r/helo", args:
> "foo=bar", client: 127.0.0.1, server: , request: "GET /t HTTP/1.1", host:
> "localhost"
> 2013/11/18 17:13:36 [notice] 19179#0: *1 rewritten data: "/r/helo?foo=bar",
> args: "", client: 127.0.0.1, server: , request: "GET /tt HTTP/1.1", host:
> "localhost"
>
这是因为 URL 的解析发生在展开 nginx 变量的值之前。所以 $value 这个整体被当作 path 来处理了(而
querystring 部分曾为空串)。从上面的调试日志的输出可以清楚地看到这一点。
如果你有兴趣的话,可以直接查看这一块逻辑的实现代码,就在 src/http/ngx_http_script.c 文件中的
ngx_http_script_compile 函数中。
Best regards,
-agentzh