Why is redirect to the first server_name happening when visiting location without trailing slash?

I have a following site config in nginx

server {
listen 80;
server_name testsite.local nginx.test;

     root /tmp;

     location /video/ {
             proxy_pass http://localhost:8080/;
     }

}

and the following line in /etc/hosts

127.0.0.1 localhost testsite.local nginx.test

When i visit http://nginx.test/video , nginx redirects me to
http://testsite.local/video/, which is the behaviour, I don’t expect at
all. It would be nice to redirect the same way, but to the same host, or
not redirect at all.

How can I disable that behavior?

Regards,
Igor K…

On Tue, Oct 27, 2009 at 01:25:47PM +0300, Igor K. wrote:

     }

How can I disable that behavior?

server_name_in_redirect off;

Igor S. wrote:

     location /video/ {

all. It would be nice to redirect the same way, but to the same host, or
not redirect at all.

How can I disable that behavior?

server_name_in_redirect off;

Thank you, Igor. My mistake not looking in the docs first.