标题:
[原创]
一个错误的域名跳转方法
[打印本页]
作者:
Goldmine
时间:
2011-6-20 23:14
标题:
一个错误的域名跳转方法
server {
listen 80;
server_name
www.nginx.org
nginx.org;
if ($http_host = nginx.org) {
rewrite (.*)
http://www.nginx.org
$1;
}
...
}
This is a wrong,
cumbersome, and ineffective way
. The right way is to define a separate server for nginx.org:
server {
listen 80;
server_name nginx.org;
rewrite ^
http://www.nginx.org
$request_uri?;
}
server {
listen 80;
server_name
www.nginx.org
;
...
}
欢迎光临 华人论坛 (http://yayabay.com/forum/)
Powered by Discuz! 7.2