复制代码代码如下:
server {
listen 80;
server_name www.zzvips.com zzvips.com;
if ($http_host = www.zzvips.com) {
rewrite (.*) http://zzvips.com$1;
}
...
}
实际标准的写法应该是
复制代码代码如下:
server {
listen 80;
server_name www.zzvips.com;
return 301 http://zzvips.com$request_uri;
}
server {
listen 80;
server_name zzvips.com;
...
}