lu2002lulu 发表于 2013-1-16 17:41:56

nginx支持泛域名支持的方法

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

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

还有些文章里面说的是:
server_name .yourdomain.com;
这个也是不行的,经过我的实验,正确的做法是:
server_name _;
这样就可以了,留个笔记,呵呵
页: [1]
查看完整版本: nginx支持泛域名支持的方法