On 31 Jan 2011 13h11 WET, appa@perusio.net wrote:
> On 31 Jan 2011 10h53 WET, zblut@cerego.com wrote:
>
> Your rewrite doesn't work because you're not passing along the
> request URI available in the $request_uri variable.
>
> Use 2 server blocks:
>
server {
## This is to avoid the spurious if for sub-domain name
## rewriting. See http://wiki.nginx.org/Pitfalls#Server_Name.
listen 80;
server_name www.foobar.com;
rewrite ^ $scheme://foobar.com permanent;
} # server domain rewrite.
I've read incorrectly what you want to do. You just want to
redirect all www.foobar.com requests to the root foobar.com. Then the
above works.
--- appa
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx