loading a different robots.txt file for a different sub domain?

Igor Sysoev igor at sysoev.ru
Fri May 21 18:24:01 MSD 2010


On Fri, May 21, 2010 at 10:03:10AM -0400, Ilan Berkner wrote:

> Worked like a charm, thanks!

You may also use:
   location = /robots.txt {
 
> On Fri, May 21, 2010 at 9:53 AM, Ray <gunblad3 at gmail.com> wrote:
> 
> > Yes.
> >
> > server {
> >    listen 80 default;
> >    server_name www;
> >
> >    location /robots.txt {
> >        alias /path/to/the/file1;
> >    }
> > }
> >
> > server {
> >    listen 80;
> >    server_name server2;
> >
> >    location /robots.txt {
> >        alias /path/to/the/file2;
> >    }
> > }
> >
> >
> > Ray.
> >
> >
> > On Fri, May 21, 2010 at 9:43 PM, Ilan Berkner <iberkner at gmail.com> wrote:
> > > Hi All,
> > > We have 2 sub-domain groups setup for processing incoming requests:
> > > 1. "server2"
> > > 2. all others, for example: "www"
> > > The 2 sub-domains share the same directory for delivery of static files
> > > (html, images, swf, etc.) but use different PHP backends.
> > > Is there a way, using nginx configuration to load a different robots.txt
> > > file when requested for one group vs. the other?
> > > Thanks!
> > >
> > >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx at nginx.org
> > > http://nginx.org/mailman/listinfo/nginx
> > >
> > >
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://nginx.org/mailman/listinfo/nginx
> >

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list