$fastcgi_script_name and $document_uri chenged after 0.5.34 ?

Rajeev J Sebastian rajeev.sebastian at gmail.com
Tue Jul 8 15:48:12 MSD 2008


Perhaps it is due to some kind of URL normalization for the // ?

You should also try to urlencode the http://www.xxxx.com/some.do so
that the special characters "/" do not appear in it in unencoded form
....

Regards
Rajeev J Sebastian

On Tue, Jul 8, 2008 at 2:04 PM, 梁冰鸿 <Binghong.Liang at rekoo.com> wrote:
> I have used nginx 0.5.34 for some days. The backend server is Django (run as
> fastcgi).
>
> I want to upgrade nginx to newer version now, but I find that all the
> versions after 0.5.34 seem to change something with $fastcgi_script_name and
> $document_uri.
>
> This is some lines in my nginx.conf
>
> location / {
>   ...
>   fastcgi_pass   127.0.0.1:10001;
>   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>   fastcgi_param SCRIPT_NAME $fastcgi_script_name;
>   fastcgi_param REQUEST_URI $request_uri;
>   fastcgi_param DOCUMENT_URI $document_uri;
>   fastcgi_param DOCUMENT_ROOT $document_root;
>   ...
> }
>
> And the Django fastcgi process listen on 127.0.0.1:10001.
>
> A url in my app is
> http://www.xxxxx.com/edit/10000/http://www.xxxxx.com/some.do
>
> The Django's urls.py map the url like this
>
> (r'^edit/(?P<topicid>\d+?)/(?P<url>.+?)$', 'myapp.views.edit'),
>
> So, when the usr click this url, the python program will get two parameters:
> topicid=10000, url=http://www.xxxxx.com/some.do
>
> It was ok when I use nginx 0.5.34. But When I use a newer version, the param
> url changed to http:/www.xxxxx.com/some.do
>
> I print SCRIPT_NAME and DOCUMENT_URI the Django, with 0.5.34 the result is
>
> SCRIPT_NAME = /edit/10000/http://www.xxxxx.com/some.do
> DOCUMENT_URI = =/edit/10000/http://www.xxxxx.com/some.do
>
> with new version the result is
>
> SCRIPT_NAME = /edit/10000/http:/www.xxxxx.com/some.do
> DOCUMENT_URI = =/edit/10000/http:/www.xxxxx.com/some.do
>
> It seems the new version had remove a '/' when the url contains '//'.
>
> Is it a bug or just a change?
>
>
>
>
>
>
>
>


More information about the nginx mailing list