rerwrite problem

Rob Schultz rschultz7 at gmail.com
Wed Jan 13 06:37:15 MSK 2010


its better to use solution like this

server {
	listen 80;
	server_name abc.com;
	access_log off;
	rewrite ^ http://www.abc.com$request_uri permanent;
}

server {
	listen 80:
        server_name www.abc.com;
        #rest of server config
}

V/r, 
Rob Schultz

On Jan 12, 2010, at 9:29 PM, lnxa wrote:

> if($host!='www.abc.com'){
>    rewrite ^/(.*)$ http://www.abc.com/$1 permanent;
>    }
> why has this error
> : unknown directive "if($host!='www.abc.com')" in /etc/nginx/nginx.conf:110
> configuration file /etc/nginx/nginx.conf test failed
> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,40554,40559#msg-40559
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100112/86400d2f/attachment.html>


More information about the nginx mailing list