remove www from the url

Dayo nginx-forum at nginx.us
Thu Feb 17 18:03:56 MSK 2011


edogawaconan Wrote:
-------------------------------------------------------
> If I remember correctly:
> 
> server {
>   server_name www.mysite.com;
>   rewrite ^ $schema://mysite.com$request_uri
> permanent;
> }

Good memory. Not "$schema" though, but "$scheme"

[code]
server {
	server_name www.mysite.com;
	rewrite ^ $scheme://mysite.com$request_uri permanent;
}
server {
	server_name mysite.com;
	...
}
[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,176137,176144#msg-176144




More information about the nginx mailing list