Phantom redirects in Log file

Patrick Mulder mulder.patrick at gmail.com
Tue Jul 3 12:45:21 UTC 2012


Hello,

I am hosting multiple domains on a vserver, and I observe some
cross-domains redirects at the end of a visit:

xxx.xxx.211.94] /  IND - Bangalore  / domain1.info / -
[03/Jul/2012:13:15:31 +0200] "GET /favicon.ico HTTP/1.1" 200 0 /
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like
Gecko) Chrome/20.0.1132.47 Safari/536.11
xxx.xxx.211.94] /  IND - Bangalore  / domain2.com / -
[03/Jul/2012:13:15:41 +0200] "-" 400 0 / -


Anyone knows why there is redirect at the end of the visiti in the
log? What's the effect for the visitor on the other end?

Here are some more details:

/etc/nginx/sites-enabled
lrwxrwxrwx 1 www-data root 30 2012-02-28 18:57 domain2.com ->
../sites-available/domain2.com
lrwxrwxrwx 1 root     root 29 2012-06-20 23:20 domain1.info ->
../sites-available/domain1.info

upstream unicorn_domain1 {
  server unix:/tmp/unicorn_domain1.todo.sock fail_timeout=0;
}

server {
             listen  80;
             server_name www.domain1.info;
             rewrite ^/(.*) http://domain1.info permanent;
}


server {
            listen   80;
            server_name domain1.info;

            root   /home/domain1/development/current/public;

            error_page  502  /502.html;

           try_files $uri/index.html $uri @unicorn_domain1;

location @unicorn_domain1 {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;
  proxy_pass http://unicorn_domain1;
}

           client_max_body_size 4G;
           keepalive_timeout 5;
           error_page 500 502 503 504 /500.html;

            location ~* \.(ico|js|css|gif|jpe?g|png)(\?[0-9]+)?$ {
                expires max;
                break;
            }

            if (-f $request_filename/index.html) {
                rewrite (.*) $1/index.html break;
            }

            if (-f $request_filename.html) {
                rewrite (.*) $1.html break;
            }

}

domain2.com
server {
            listen   80;
            server_name domain2.com;

            root   /home/domain2/development/current/public;

            error_page  502  /502.html;

            location ~* \.(ico|js|css|gif|jpe?g|png)(\?[0-9]+)?$ {
                expires max;
                break;
            }

            if (-f $request_filename/index.html) {
                rewrite (.*) $1/index.html break;
            }

            if (-f $request_filename.html) {
                rewrite (.*) $1.html break;
            }

}



More information about the nginx mailing list