$fastcgi_script_name and $document_uri chenged after 0.5.34?

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\d+?)/(?P.+?)$', ‘myapp.views.edit’),

So, when the usr click this url, the python program will get two
parameters:
topicid=10000, url=xxxxx.com

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/xxxxx.com
DOCUMENT_URI = =/edit/10000/xxxxx.com

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?

On Tue, Jul 08, 2008 at 07:20:25PM +0800, Kelvin wrote:

It was ok when I use nginx 0.5.34. But When I use a newer version, the param
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?

Try

server {
merge_slashes off;