Phantom redirects in Log file

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;
        }

}

Hello!

On Tue, Jul 03, 2012 at 02:45:21PM +0200, Patrick M. wrote:

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

Why do you think it’s redirect? Most likely “domain2.com” is just
a default server on the listen socket used, and an invalid request
(or, rather, a connection without a request at all) was logged in
it’s context.

See here for more details:
http://nginx.org/en/docs/http/request_processing.html

Maxim D.

On Tue, Jul 3, 2012 at 3:03 PM, Maxim D. [email protected] wrote:

Why do you think it’s redirect? Most likely “domain2.com” is just
a default server on the listen socket used, and an invalid request
(or, rather, a connection without a request at all) was logged in
it’s context.

See here for more details:
http://nginx.org/en/docs/http/request_processing.html

Thanks, that helps in my understanding! I’ll test the influence of
having the default_server set to domain1.
Btw, is there some help / tools to see the difference between a
connection and an HTTP request?