> Would this help? [note: from memory, not tested]
>
> location = /favicon.ico {
> try_files /images/$server_name.ico /favicon.ico =204;
> }
>
> M.
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
I have several vhosts, this is part of the config file for vhost in question:
server_name sub1.domain.com *.mydomain.com mydomain.com sub2.domain.com;
if ($host = www.mydomain.com){
rewrite ^/favicon.ico$ /favicon_mydomain.ico break;
}
if ($host = boat.mydomain.com){
rewrite ^/favicon.ico$ /favicon_boat.ico break;
}
if ($host = car.mydomain.com){
rewrite ^/favicon.ico$ /favicon_car.ico break;
}
etc...
I plan to put all .ico files in /images/ dir.
favicon_mydomain.ico
favicon_boat.ico
favicon_car.ico
and many more...
So what I need is next:
when request is happens for car.mydomain.com,
nginx searches for /images/favicon_car.ico and it serves it if exists,
if not than serves regular favicon.ico.
Please help...