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

Igor Katson descentspb at gmail.com
Tue Oct 27 13:25:47 MSK 2009

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	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?

Igor Katson.

More information about the nginx mailing list