Ok, the "for some reason" I mentioned below turns out to be the order
in which my vhosts were listed.  The redirect always goes to the first
vhost that was setup.. probably a bug in nginx or perhaps a snafu in
my config.  Moving my foo.com entry to the front of the line enabled
your rewrite line to work.

Thanks,
Vince

On 9/28/07, Vince Wadhwani <[EMAIL PROTECTED]> wrote:
> Yeah for some reason that doesn't work for me.  After I do that and go
> to foo.com it instead redirects me to one of the other vhosts on that
> server.  Weird.
>
> On 9/28/07, Chris T <[EMAIL PROTECTED]> wrote:
> >
> > Vince W. wrote:
> > > Is there an easy way to redirect foo.com to www.foo.com in nginx?
> > > Either that or if somebody knows a way to get restful authentication to
> > > store a cookie for either www.foo.com or foo.com that would be great.
> > > My current cookie is stored with this line:
> > >
> > >
> > > cookies[:auth_token] = { :value =>
> > > self.current_user.remember_token,:expires =>
> > > self.current_user.remember_token_expires_at }
> > >
> > > I tried adding :domain => '.foo.com' but that didn't seem to work.  I
> > > figure the nginx redirect would be the easiest thing...
> > >
> > >
> > > Thanks.
> > >
> > I'm using something like the following and it seems to work OK:
> >
> >     server {
> >         server_name www.foo.com;
> >         rewrite ^/(.*) http://foo.com/$1 permanent;
> >     }
> >
> >
> > --
> > ----------------------------
> > Autopendium :: Stuff about old cars
> > http://autopendium.com
> >
> >
> > > >
> >
>
>
> --
> support independent business -- http://www.buyindie.net/
>


-- 
support independent business -- http://www.buyindie.net/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to