笔调 Bidiao.com 帆的姿态 About something . Records my work and life .

28十/110

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 [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;
这个也是不行的,经过我的实验,正确的做法是:
listen 80;
server_name _;
这样就可以了,留个笔记,呵呵

另外还有种泛域名写法,和上面这种方法一样,都没测试过,大家自己测试吧:

www.demo.com .demo.com

喜欢这个文章吗?

考虑订阅我们的RSS Feed吧!

评论 (0) 引用 (0)

还没有评论.


Leave a comment

(required)

还没有引用.