problem with nginx-0.3.48

Igor Sysoev is at rambler-co.ru
Wed May 31 17:33:56 MSD 2006


On Wed, 31 May 2006, Andrei Nigmatulin wrote:

> У меня проблема с nginx, не могу ее решить самостоятельно, прошу Вашей помощи.
>
> Делаю так:
>
>        location ~ ^/[^/]+/invite/ {
>            if ($request_uri ~* "/([^/]+)/invite/([^/]+)/(.*)" ) {
>                set $login $1;
>                set $invite_id $2;
>                set $location $3;
>            }
>            fastcgi_param login $login;
>            fastcgi_param invite_id $invite_id;
>            fastcgi_param location $location;
>            fastcgi_param PATH_TRANSLATED /home/anight/nginx-bug/test.phtml;
>            fastcgi_param REQUEST_URI       $request_uri;
>            fastcgi_param REQUEST_METHOD    $request_method;
>            fastcgi_pass    127.0.0.1:8002;
>        }
>
> в test.phtml:
>
> <?
>    echo $_SERVER["location"];
> ?>
>
> Делаю запрос:
>
> http://localhost:8000/test/invite/35264/search/?q=Learn+french
>
> Скрипт отвечает:
>
> search/%3fq=Learn%2bfr
>
> Ожидаю увидеть от скрипта:
>
> search/%3fq=Learn%2bfrench
>
> В чем тут может быть проблема ?

Прилагаемый патч решает эту ошибку.
Вывод должен быть "search/%3fq=Learn%2bfrench".


Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
--- src/http/ngx_http_script.c	Wed May 24 20:05:26 2006
+++ src/http/ngx_http_script.c	Wed May 31 17:27:59 2006
@@ -501,7 +501,7 @@
             && (e->request->quoted_uri || e->request->plus_in_uri))
         {
             return e->captures[code->n + 1] - e->captures[code->n]
-                   + ngx_escape_uri(NULL,
+                   + 2 * ngx_escape_uri(NULL,
                                 &e->line.data[e->captures[code->n]],
                                 e->captures[code->n + 1] - e->captures[code->n],
                                 NGX_ESCAPE_ARGS);
@@ -1016,9 +1016,11 @@
     ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
 
     le.ip = code->lengths->elts;
+    le.line = e->line;
     le.request = e->request;
     le.captures = e->captures;
     le.ncaptures = e->ncaptures;
+    le.quote = e->quote;
 
     for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) {
         lcode = *(ngx_http_script_len_code_pt *) le.ip;


More information about the nginx-ru mailing list