中国青基会

查看完整版本: nginx支持泛域名支持的方法

magic 2009-1-10 19:34

nginx支持泛域名支持的方法

要使用Nginx下的泛域名支持,必须在编译 Nginx的时候加上
--with-http_sub_module
freebsd下ports安装的时候有提示的,选上即可。

方法我google了半天,网上的好多我照做都是不行的,例如这个:
listen       80;
server_name  [url=http://www.yourdomain.com/][color=#0000ff]www.yourdomain.com[/color][/url] *.yourdomain.com;
这个会提示:
# nginx -t
2009/01/04 13:22:56 [emerg] 63944#0: conflicting parameter "*.bsdlover.cn" in www.conf:14
2009/01/04 13:22:56 [emerg] 63944#0: the configuration file nginx.conf test failed

还有些文章里面说的是:
server_name  .yourdomain.com;
这个也是不行的,经过我的实验,正确的做法是:
server_name  _;
这样就可以了,留个笔记,呵呵



原文地址:[url=http://www.bsdlover.cn/html/11/n-2011.html]http://www.bsdlover.cn/html/11/n-2011.html[/url]][color=#0000ff]http://www.bsdlover.cn/html/11/n-2011.html[/color]
页: [1]
查看完整版本: nginx支持泛域名支持的方法
Baidu