That rule must do:
1.For subdomains example1,example2… to check in location
/images/$host.ico is there a favicon_example.ico file and serve it.
2.If there is no such file, than to serve just a plain favicon.ico file.
From you description I don’t fully understand what exactly is your
current
file structure but you can use try_files ( http://wiki.nginx.org/HttpCoreModule#try_files ) and add the $host
variable
in whatever place is needed.
Can’t do that, because I have to serve different favicon.ico to
different
subdomain.
In example, there is several domains in server_name and some of them
need
to have their own favicon.ico,
if there is no favicon.ico for some of them, than they need to be served
with the main favicon.ico file.
Can’t do that, because I have to serve different favicon.ico to different
subdomain.
In example, there is several domains in server_name and some of them need
to have their own favicon.ico,
if there is no favicon.ico for some of them, than they need to be served
with the main favicon.ico file.
Anything except favicons in this servers is the same ?
Please explain your question.
If I understand you correctly, you are asking is every subdomain have
their
own page, than yes.
The trick is that if subdomain have it’s own favicon than it needs to be
served with it, if not, than to be served with main favicon.ico…
Anything except favicons in this servers is the same ?
Please explain your question.
If I understand you correctly, you are asking is every subdomain have their
own page, than yes.
The trick is that if subdomain have it’s own favicon than it needs to be
served with it, if not, than to be served with main favicon.ico…
The question is why do you try to push everything inside one server
instead of separating processing in several servers:
So what I need is:
when request is for something1.domain.com.ico happens
than to check in location /images/ is there a file
something1.domain.com.ico
and serve it if it is there,
but if there is no such a file, than to serve clasic favicon.ico file.
On Fri, Aug 31, 2012 at 09:52:48AM -0400, nexon wrote:
The trick is that if subdomain have it’s own favicon than it needs
I am using several vhosts and this is part of the setup file for one of
}
So what I need is:
when request is for something1.domain.com.ico happens
than to check in location /images/ is there a file something1.domain.com.ico
and serve it if it is there,
but if there is no such a file, than to serve clasic favicon.ico file.
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.
Yes, this would be much beter, but I am stuck with my conf as it is…
The more complex configuration I will eventually create the more often
you will stuck with it. It’s better to create a scaleable configuration
from the very start or at least as early as possible.
–
Igor S.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.