Nginx 泛解析

Nginx二级域名泛解析到子目录
Nginx多目录多虚拟主机情况泛解析


绑一堆域名实在太麻烦,假设需求场景如下:

二级/三级域名      对应web程序目录
*.household114.com       /phpweb/household114/
abc1.household114.com   /phpweb/household114/abc1.household114.com
abc2.household114.com   /phpweb/household114/abc2.household114.com
abc3.household114.com   /phpweb/household114/abc3.household114.com
……


Nginx配置如下:

server
        {
                listen       80;
                server_name household114.com *.household114.com;
                root  /phpweb/household114/$host/;
                #Configuration is omitted……
        }

补充:首选需要在DNS中配置泛解析到该机器IP。

相关文章

此处评论已关闭