Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rewrite со слешом
- To: nginx-ru@xxxxxxxxx
- Subject: Re: rewrite со слешом
- From: Sergey Shepelev <temotor@xxxxxxxxx>
- Date: Tue, 4 Aug 2009 23:17:01 +0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9ZmWRTFeyinba7I8oU7cWHC8NbjPzXQ25pYlk7rfPOM=; b=XIt1kn/DJ8ZGdSC7jID51jAIoDehwWLspM5E7ZtOd17rAkcLOxaM+rP9WYMruHHO01 NFbwzuw1NqV9yKJzg/AffhuZGyUYGK34RyaFmIXmK6aXVRgAUh4tuRoVROpHLRsMoFPQ OQallL3As1OO61cZRhlo/AxBR7D1uYqydqkcE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mxmjrL8r4JCyynbQbjJQMmwo/fVji6j6RVk+9ApxurDRP7xDEpCavL7U0NCMYICoql N7fJge/s0LmPRLYdisK7Xd1fwlpJnVVaX9C11BnoRvyjWe0Rhf+yuiik7U0YN5yhbscs vHdDJFoCR8pEgpveowe0SW46afaV5pOwr7DRs=
- In-reply-to: <h59qm3$78t$1@xxxxxxxxxxxxx>
- References: <h59qm3$78t$1@xxxxxxxxxxxxx>
RFC2616
5.1.2 Request-URI
...
The Request-URI is transmitted in the format specified in section
3.2.1. If the Request-URI is encoded using the "% HEX HEX" encoding
[42], the origin server MUST decode the Request-URI in order to
properly interpret the request. Servers SHOULD respond to invalid
Request-URIs with an appropriate status code.
...
Здесь написано, что nginx обязан развернуть все %hex hex в запросе.
Таким образом, ваш запрос эквивалентен такому:
GET /1/2 HTTP/1.0
Ну, и реврайт отработал нормально. ^(/1.*[^a])$ матчит весь URI /1/2 и
добавляет .a.
2009/8/4 Dmitriy MiksIr <miksir@xxxxxxxx>:
> Если в выделении есть заенкоденный слеш - он разворачивается. В итоге это
> приводит к таким вот результатам:
> rewrite ^(/1.*[^a])$ $1.a redirect;
>
> GET /1%2F2 HTTP/1.0
>
> HTTP/1.1 302 Moved Temporarily
> Server: nginx/0.7.55
> Location: http://st.miksir.test.autocom/1/2.a
>
>
>
|