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:
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.
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.
Did you try with
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.
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.
nginx defaults to the first vhost when it can’t find the host so it
may well be your re-write isn’t working.